web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / The gallery only show ...
Power Apps
Unanswered

The gallery only show multiple collected items, but it won't show a single collected item. Please, help

(0) ShareShare
ReportReport
Posted on by 85

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? 

1.jpg
2.jpg
Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @FLOWPA ,

     

    The reason is in the two cases the column names are different, when using the Split function, the result table column name would be "Result" while directly collecting the record the column name would be "Value".

     

    So you could try to rename the columns, look into the secondary gallery and find the Image property of the Image control, if it is ThisItem.Result then:

    If(var_Count_Docs_Links=1, ClearCollect(coll_Docs_Extracted_Links, {Result:var_GallerySub_JAPPs_File_Links}))

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @FLOWPA ,


    Have you resolved the issue? 

    If above post helps, then please consider Accept it as the solution to help the other members find it.


    Best regards,
    Community Support Team _ Jeffer Ni

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard