Hi,
There is a main screen, with a Main Gallery, displaying a list of users and their applications.
Users info are stored into a google sheet.
Users photos are collected using URLs. Multiple URL are divided by " | ".
Usually there are only between 1 to 5 photos max.
I have a formula to split the URL record into multiple URL.
Also there a URL counter. If "https://" is found within the record, then count the number of URLs.
If 1 URL is found, then add to new collection
If more than 1 URL is found, then split each URL and add them into a new collection.
The URL collection is temporary, just to visualize it. ClearCollect is used to clear the collection before viewing a different user.
The users photos can be visualized into a secondary gallery on a secondary screen.
This works perfectly fine when the record contains multiple photos URL. The photos and URLs are visible.
PROBLEM: when there is only 1 URL, the gallery won't display the image, nor the URL label (this label is for debug).
In the attached screenshots:
1st: the secondary gallery has only 1 record and it's not visible (But I have an external debug Label and debug Image, that correctly display the image and URL. The debug image is set to: First(Gallery_Subgallery_of_Selected_Main_Gallery_items.AllItems).uploaded_photo)
2nd: the gallery has 4 records and all 4 are visible when scrolling down
Here is my current code:
//EXTRACT LINKS FROM STRING
Set(var_GallerySub_JAPPs_File_Links, Trim(Gallery_Main.Selected.uploaded_photo));
Set(var_Count_Docs_Links, CountRows(MatchAll(Lower(var_GallerySub_JAPPs_File_Links),"https://")));
//IF 1 COLLECT ONLY 1 PHOTO
If(var_Count_Docs_Links=1, ClearCollect(coll_Docs_Extracted_Links, var_GallerySub_JAPPs_File_Links));
//IF THERE ARE MORE THAN 1 URL => THEN SPLIT THE STRING INTO MULTIPLE URL AND COLLECT THEM
If(var_Count_Docs_Links>1, ClearCollect(coll_Docs_Extracted_Links, Split(var_GallerySub_JAPPs_File_Links," | ")));
Why this gallery won't show 1 only photo? Can only 1 item be added into a collection? If so, what's the proper way to add 1 item into a collection?