Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

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

(0) ShareShare
ReportReport
Posted on by 821 Super User 2025 Season 1
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?
  • futr_vision Profile Picture
    821 Super User 2025 Season 1 on at
    Can't get edit form to submit dependent combo box selections
    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.
  • Suggested answer
    DBO_DV Profile Picture
    4,534 Super User 2025 Season 1 on at
    Can't get edit form to submit dependent combo box selections
    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
    821 Super User 2025 Season 1 on at
    Can't get edit form to submit dependent combo box selections
    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
    DBO_DV Profile Picture
    4,534 Super User 2025 Season 1 on at
    Can't get edit form to submit dependent combo box selections
    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
    821 Super User 2025 Season 1 on at
    Can't get edit form to submit dependent combo box selections
    The Default for the parent combo boxes is nothing. The DefaultSelectedItems for the parent, in this case, is 
    {dk_campaigntypename: Parent.Default}
     
  • DBO_DV Profile Picture
    4,534 Super User 2025 Season 1 on at
    Can't get edit form to submit dependent combo box selections
    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
    821 Super User 2025 Season 1 on at
    Can't get edit form to submit dependent combo box selections
    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard