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 / Still have issues with...
Power Apps
Suggested Answer

Still have issues with dependent combo boxes when using a form to edit an existing record

(0) ShareShare
ReportReport
Posted on by 831 Moderator
 
I never got to a solution that works as you can see. Here is the situation I outlined in that post,
 
Here is my situation
  1.  I have a gallery that returns records from Dataverse table
  2. When you select a gallery item the record is written to a global variable (I used a global variable because there is also a copy record function on the page that navigates the users back to the original form and populates it with the copied record for editing)
  3. I have a form on the page that uses the global variable data as the Items property
  4. In the form I have some dependent combo boxes. These function as expected. When and item from the parent is selected the values available in the child combo box are changed.
This all works fine. But I am having issues with the behavior I want the child combo boxes to have. Here is what I want to happen.
  1. When a parent combo box is changed I want the child combo box(es) to appear blank.
  2. If the child combo box is required I want that to be respected by the form
 
I've yet to find an acceptable solution. If it was just a regular form then it's easy enough to use OnChange to control the reset of the child combo boxes but when dealing with a gallery, every gallery selection triggers the OnChange resulting it unwanted outcomes. If anyone can please help me find a solution I would greatly appreciate it. I've been trying to solve this, on and off, for the last 4-5 months. I'm at a point where I need to get this working so the app can be rolled out. TIA!!!!
Categories:
I have the same question (0)
  • Suggested answer
    Kellboy2243 Profile Picture
    51 on at
    Hi 
     
    Try these steps below.
     
    1. On the Onchange property of the parent combobox, reset child combobox by using the function
    Reset(ChildComboBoxName)
    2. There are multiple ways to do this but the fastest way is to set the required property of the datarcard for your combobox to true. The datacard is what connects the combobox field to the column on your datasource. If you do this correctly, it should throw an error when you try to submit the form without the child combobox been selected.
  • futr_vision Profile Picture
    831 Moderator on at
    Kellboy2243 Selecting a gallery item triggers the OnChange. That means when I go to edit that record the child combo box is going to be reset even though I may not want to change it. OnChange has been an issue.
  • futr_vision Profile Picture
    831 Moderator on at
    Anyone with thoughts on how to solve this?
  • ronaldwalcott Profile Picture
    3,862 Moderator on at
    Do these problems only occur when using a global variable as your form's data source or do they also occur when using the selected item from the gallery (presumably the required item requirement is managed automatically here)?
  • futr_vision Profile Picture
    831 Moderator on at
    I believe it happens in both scenarios but let me give that a try. I do see this in my history of things I have tried.

    UpdateContext({varGalSelected: ThisItem.'Project Reference Number'});
    ​​​​​
  • futr_vision Profile Picture
    831 Moderator on at
    I think part of my problem is this
     
    {Value:If(varResetSubLedgerReview,Blank(), Parent.Default)}
    If I hover over varResetSeubLedgerReview it returns false
    If I hover over Default in Parent.Default, I see the correct value
     
    But this statement doesn't return a value
    "(S)Sub Ledger: " & CB_SubLedgerReview.Selected.'Sub Ledger Name'
     
  • Suggested answer
    futr_vision Profile Picture
    831 Moderator on at
    Ok. After much tinkering I think I found my answer.
     
    Parent Combo Box
    OnSelect
    UpdateContext({varResetSubLedgerReview: false});
    UpdateContext({varResetSubLedgerReview: true});
    Child Combo Box
    DefaultSelectedItems (This is where I made my change by rearranging the argument)
    If(varResetSubLedgerReview,{Value: Blank()}, {dk_subledgername: Parent.Default})
    
    Reset
    varResetSubLedgerReview
    This seems to be doing exactly what I want although I see one oddity with another set of parent-child combo boxes. I make another post for that one.
     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard