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 / What is the best way t...
Power Apps
Unanswered

What is the best way to populate and edit form from a gallery?

(0) ShareShare
ReportReport
Posted on by 831 Moderator

When I first started developing my review/edit screen I added a gallery and set the edit form items to gallery.selected. While that usually works I had some issues with certain controls not being populated. I have switched the selected gallery item to push the record to a variable instead(glbFormData). My question is how to populate the controls? By default they use Parent.Default but this doesn't always work. Should I be referencing the glbFormData variable instead? Like this:

 

Text field example - glbFormData.'Campaign Notes'

Combo box example - {dk_tacticname:glbFormData.Tactic}

 

Is this best? Is there a better way? Anything I should look out for?

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @futr_vision whether you use a Variable or Gallery.Selected, the results will be the same because both options will return a record. I assume you're not having problems with the Text input control but you're experiencing issues with the ComboBox control.

     

    Assuming you're using Parent.Default on the DefaultSelectedItems property, then this is correct. If you're having issues, I would suggest checking the Items property of that ComboBox and ensure the Default property of the DataCard container is something like "ThisItem.'Your Field Name'".

  • futr_vision Profile Picture
    831 Moderator on at

    The method I chose was to push the gallery item record to a global variable and then reference the column as I outline. Seems to work great but it does fail in one specific instance. I have a combo box control that becomes visible if a radio button's value is yes. If it is yes then there should be a value to populate that combo box but for some reason it doesn't, and I do not receive any errors. Here is the code I am using for the DefaultSelectedItems. 

     

    If(
     Self.DisplayMode=DisplayMode.Edit && Text(RB_PartneringReview.Selected.Value) = "Yes", 
     If(
     IsBlank(newPartner),
     {CB_PartnerNameReview: glbFormData.'Partner Name'},
     newPartner
     ), 
     Blank()
    )

     

    If I click on the glbFormData.'Partner Name' it show me the value 'Test Partner 4'. Just to make sure I added a label to the app and set the text to glbFormData.'Partner Name'. Sane results. I'm just not sure why the combo box is blank unless I am blanking it out some other way?

     

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @futr_vision sorry I did not receive a notification that you had responded. 

     

    What is "newPartner" ? Another variable?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard