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 / Can't get edit form to...
Power Apps
Unanswered

Can't get edit form to submit dependent combo box selections

(0) ShareShare
ReportReport
Posted on by 831 Moderator
I have an edit form that populated when a record is selected from the gallery. This record's data is written to a global variable which is then used as the Item for the form. In this form I have a handful of dependent combo boxes. These were recently updated so that the combo boxes would be set to blank if the parent combo box was changed. Here is the code I am using.
 
For the parent combo box I used something like this in the OnChange property:
 
UpdateContext({varResetCampaignSource: false});
UpdateContext({varResetCampaignSource: true});
 
Then for the child's Reset property I would use:
 
varResetCampaignSource
 
For the child's DefaultSelectedItems property I am using:
 
{
 Value:
 If(
 varResetCampaignSource,
 Blank(),
 Parent.Default
 )
}
The resetting of the child combo box works great when the parent is changed but when I go to submit the update to the form the child fields go back to being blank and nothing is written to the database. How do I fix this?
Categories:
I have the same question (0)
  • futr_vision Profile Picture
    831 Moderator on at
    Update. It looks like I am getting the records o submit but when I load up the record the child combo boxes are blank. Looks like there is something going on with the varResetCampaignSource being set to true that might be blanking out the child combo boxes on gallery item selection? Not sure exactly what it is. I tried setting the OnSelect of the gallery items and setting that to varResetCampaignSource to false but as soon as I choose another item it gets set back to true.
  • Daniel Bocklandt Profile Picture
    5,099 Super User 2025 Season 2 on at
    Hey, it has probably something to do with you if Statement. 

    As soon as something gets changed your combobox will be blank. 

    What is the default of the Parent combobox. Could we somehow take this as the if statement. 

  • futr_vision Profile Picture
    831 Moderator on at
    The Default for the parent combo boxes is nothing. The DefaultSelectedItems for the parent, in this case, is 
    {dk_campaigntypename: Parent.Default}
     
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,099 Super User 2025 Season 2 on at
    We could start by stopping the If statement to be triggered over and over for every change  so use this only; 
    UpdateContext({varResetCampaignSource: true});
    In the Submit button you could set it back like this: 
    SubmitForm(Form1);
    UpdateContext({varResetCampaignSource: false});
    ResetForm(Form1);
     
     
     
  • futr_vision Profile Picture
    831 Moderator on at
    I can see how that will work but doesn't this break the functionality of resetting the combo boxes? It would work the first time, but it wouldn't work on a second change correct?
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,099 Super User 2025 Season 2 on at
    Yes exactly but would you need to change the dropbox over and over before submitting the form? 
     
    If that's the case I would rethink the way you build your app. Maybe there would be a better way to get it done. 
  • futr_vision Profile Picture
    831 Moderator on at
    I ca see this happening as users get used to the app. I would hope the changes would only happen once. Ultimately, the app should stand up to any scenario I believe.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard