Skip to main content
Community site session details

Community site session details

Session Id : wX13aZ1jyEcmRpfnynY2X6
Power Apps - Building Power Apps
Answered

Selecting gallery row based on form value, updating form value if selected gallery changes

Like (0) ShareShare
ReportReport
Posted on 24 Sep 2021 21:18:20 by 212

Sorry for the long subject line but I did not know how to describe my issue in a few words.

 

I have a SP list of observations. Each observation can reference 1 row in a gallery. The two are linked via id. When I open the form in Edit mode, I'd like to select the row based on the id stored in the form. but the row in the gallery can change and if it changes, then I'd like to update the id in the form.

 

I've set the default in the gallery as a lookup to the id on the form and the id on the form is set to the selected row on the gallery.  And, it makes sense that this is causing a circular reference error. Any ideas on how best to resolve/implement?

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    148,944 Most Valuable Professional on 07 Oct 2021 at 23:15:20
    Re: Selecting gallery row based on form value, updating form value if selected gallery changes

    Hi @ruth ,

    Not really possible from what I understand from your description - it is still circular.

  • ruth Profile Picture
    212 on 07 Oct 2021 at 22:20:32
    Re: Selecting gallery row based on form value, updating form value if selected gallery changes

    @WarrenBelz , I think you've answered my question, but to be sure, I'll explain a little more. I have a combo box in a form that stores an id from another Sharepoint list. I display the "other list" on the screen as a gallery. When a user selects the item from the combo box, the row in the "other list" is highlighted. This works perfectly. I was hoping to be able to allow the user to select a row from the "other list" and when they did, populate the combo box with that selected value.

  • WarrenBelz Profile Picture
    148,944 Most Valuable Professional on 29 Sep 2021 at 21:44:05
    Re: Selecting gallery row based on form value, updating form value if selected gallery changes

    @ruth ,

    I am still a little unclear exactly what you want to do, but you cannot refer a control to itself, two controls to each other or have a "circle" of references. Can you please explain in a bit more detail exactly the result you want to achieve.

  • ruth Profile Picture
    212 on 29 Sep 2021 at 19:37:55
    Re: Selecting gallery row based on form value, updating form value if selected gallery changes

    Hi Warren,

     

    Thanks for the response. The challenge is that I do not want the selected id from the gallery to drive the contents of the form but rather I'd like for it to work with my combo box.  The gallery has a list of other helpful information that I cannot put into the combobox.

     

    I am able to "highlight" the row in the gallery based on the value I select in the combo box, but I cannot change the contents of the combo box based on a row selected in the gallery (as this is where the circular reference occurs).

  • WarrenBelz Profile Picture
    148,944 Most Valuable Professional on 24 Sep 2021 at 23:06:46
    Re: Selecting gallery row based on form value, updating form value if selected gallery changes

    Hi @ruth ,

    Yes, that certainly is a Circular Reference, however if you do this - OnSelect of the Gallery

    Set(gblID,ThisItem.ID)

    and the Item of the Form is 

    LookUp(
     ListName,
     ID=gblID
    )

    you can also highlight the selected item in the gallery with the TemplateFill

    If(
     ThisItem.IsSelected,
     YourHighlightColour
     White
    )

     

    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.

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete