I feel like ive either gone beyond reasonable thinking but i cannot for the life of me get retool to select a 2nd image if the first one returns a null value. I have tried the following
Ah ok, and what are the values of the items.images objects?
If the first path (item.images.png.md_2x1_3.url) has any value at all then the javascript will try to use that as the image source and then won't fallback to the second one.
The || logic will only work if the first part is nullish - you may need to change your query or data or logic here to make it understand that.
Strange, this works for me in a test application using that null || not null approach. Confusing. Might be something the support team can look into a bit more closely for you.
I will send them a message, i cant currently get on the mobile app builder it will not load. I will let you know unless anyone else knows what the outcome is.
Hey @danny! Can you try using optional chaining? e.g. {{item.images.png?.xyz.url || item.images.jpg?.xyz.url}}
If the item you're accessing does not have a png or jpg property the transformer will error when trying to access the xyz property on it causing the whole thing to return null.
whilst your here do you know how we can make the images clickable? i did try html code but that didnt work. ideally to make them full screen but even a link to a website would be good.
Have you already experimented with adding a Press handler to the collection view itself? You can use this to open a separate screen in your app that contains a larger version of the image, or otherwise open a URL of the full image.
thats ok but for image really like many other mobile apps pressing a image just enlarges it as a overlay. The tables on a app on a computer does this great. Due to my app been all data pulled from a api (I am new to this mobile side of retool and its differences i will confess now) i will play with creating a new page based on the users clicking it is not ideal but maybe retool can look at images been more like how were used to with other mobile apps. Thanks for your response though. Also can retool look at making apps public without the need for people needing to sign into an account.