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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery Select Item
Power Apps
Unanswered

Gallery Select Item

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

Back again for more help please.

I thought it will be plain sailing after getting previous help from here which resulted successfully with linking 2 x SharePoint lists (List A and List B) to 6 forms. All of these forms are working perfectly.

 

My issue right now is this, I’ve added a gallery.  The gallery select item only selects the first item i.e. if I select ID 1 the gallery take me to item ID 1. When I select ID 2 to edit, the gallery take me to item ID 1, and so forth with the rest of the items.

 

The Gallery “on select property has the following code Set(varRecord,ThisItem)

 

List A has (4) forms and their Item property have the following code,  If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@List A]),SharePointIntegration.Selected)

 

And List B has (2) forms and they have the following code in the Item Property LookUp(List B, ID = SharePointIntegration.Selected.ID)

 

I have tried different Gallery code like “Gallery1. Selected or LookUp(List A, ID = Gallery1.Selected.ID) but nothing works.

 

If I use only List A with a Gallery, then the Gallery1 works okay but I need List B to be updated as List A and List B make the whole form up.

Please help or advise me with what I’m trying to do is possible, otherwise I will give up on adding a Gallery for editing forms in Lists A and forms in List B.

 

Thanking you in advance

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,024 Most Valuable Professional on at

    Hi @Moe69 ,

    You need the Item in the same format and conditional on something being in varID

    With(
     {
     wID:
     If(
     varRecord.ID > 0,
     varRecordID,
     SharePointIntegration.SelectedListItemID
     )
     },
     LookUp(
     SPListName,
     ID = wID
     )
    )

    NOTE: one of the dangers of what you are doing with an Integrated App (galleries and multiple screens which they were never really designed for) is that if you change records without refreshing SharePoint, you could end up with the wrong record displayed.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Moe69 Profile Picture
    on at

    @WarrenBelz 

    Hi,

    Thank you for responding back, I'm just about to try your advise code, in the meantime, could you explain what the letter w, where you have wID please? 

     

    i also have taken on board your advise regarding refreshing SharePoint. is this something i can add on the success in the form part to refresh perhaps?

  • Moe69 Profile Picture
    on at

    Hi @WarrenBelz 

    I have added the code into the Gallery Item property and i only get 1 record showing rather then the 5 i have created to select from?

    Also the code 

    With( { wID: If( varRecord.ID > 0, varRecordID, SharePointIntegration.SelectedListItemID ) }, LookUp( SPListName, ID = wID ) )

    the second part of varRecordID didnt work so i added the dot in to varRecord.ID which then worked but again only showing 1 item rather then the 5 items in the list to select from 

  • WarrenBelz Profile Picture
    153,024 Most Valuable Professional on at

    Hi @Moe69 ,

    That is just my naming protocol for With() variables - you can call it whatever you want as long as you refer to it in the code below. Unfortunately refreshing SharePoint need to be done in SharePoint.

  • WarrenBelz Profile Picture
    153,024 Most Valuable Professional on at

    Hi @Moe69 ,

    ID is a unique identifier - you will always only ever have one record with the same ID.

  • Moe69 Profile Picture
    on at

    Hi @WarrenBelz 

    Thank you for responding back, unfortunately the code only showing 1 record rather then the 5 items that are in the list to select from.  any reasons as to why please?

    Have i missed out something or settings?  

  • WarrenBelz Profile Picture
    153,024 Most Valuable Professional on at

    Hi @Moe69 ,

    I am getting a little lost here - this is an Integrated App - you just need to select the record from SharePoint. What is it exactly you are trying to do with the gallery ?

  • Moe69 Profile Picture
    on at

    Hi @WarrenBelz 

     

    Apologies in advance,

    I wanted to create a HomeScreen with a Gallery so that the users can select their items in the Gallery that will takes the user direct to that item selected to be updated, and i thought this would be an easy option to have a Gallery on the HomeScreen. 

     

    if using a Gallery is not possible, is there something i could use perhaps?

     

     

    but if you are advising that this is not possible then i will not add a HomeScreen with a Gallery.

  • WarrenBelz Profile Picture
    153,024 Most Valuable Professional on at

    Hi @Moe69 

    Unusual on an integrated app (this sounds more like a Canvas App). Which list is the gallery based on and what is the Items property ?

  • Moe69 Profile Picture
    on at

    Hi @WarrenBelz 

    The Gallery is linked to List A 

    List A property =

    If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@List A]),SharePointIntegration.Selected)

    As i said previously, List A has 4 forms and List B has 2 forms which complete the whole form.

    The issue i have here is the Gallery only selects the first item, even if i select another item record it only goes to the first record. maybe it me not able to explaining correctly  

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard