web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Issue with getting child combo box to show Parent.Default

(0) ShareShare
ReportReport
Posted on by 831 Moderator
I have a series of parent/child combo boxes in an edit form. After much struggle I finally got them to behave the way I want them too. Here is how this looks.
 
  1. When the parent is changed the child is set to blank
  2. If the parent is not changed the child shows the Parent.Default value if there is one.
Pretty simple. The problem is one of my child combo boxes is not behaving as the others. Here is an example of what currently have implemented for those that are working
 
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
 
Now, the only real difference between the child combo boxes that behave and the one that doesn't is this. The ones that work is that the Items property is being pulled from a data source like this
Sort(Filter('Cost Center Sub Ledgers', 'Cost Center Name' = CB_CostCenterReview.Selected.'Cost Center Name'), 'Sub Ledger Name', SortOrder.Ascending)
and the 'misbehaving' child combo box's Items property is hard coded like this
[1,2,3,4,5,6]
 
I know there is a value for Parent.Default for this 'misbehaving' child combo box. I've added a label to check
"(P)Email Sequence: " & DC_EmailSequenceNumberReview.Default
 
And rolling over the Parent.Default in the code below also gives me the value I expected.
If(varResetEmailSequenceReview,{Value:Blank()}, {dk_emailsequencenumber: Parent.Default})
 
Any ideas why it is not showing? The column type in the table is Text. The only thing I can think of is what I mentioned about how the Items property is set up.
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    152,811 Most Valuable Professional on at
    Issue with getting child combo box to show Parent.Default
    If the Items of the Combo Box is
    Sort(
       Filter(
          'Cost Center Sub Ledgers', 
          'Cost Center Name' = CB_CostCenterReview.Selected.'Cost Center Name'
       ), 
       'Sub Ledger Name', 
       SortOrder.Ascending
    )
    then I am going to assume that the field you are displaying is 'Sub Ledger Name' and the DefaultSelectedItems would be something like (using the actual field name in the list displayed is this is incorrect)
    {
       'Sub Ledger Name':
       If(
          varResetSubLedgerReview, 
          Blank(),
          ThisItem.'Sub Ledger Name'
       )
    }
    Value has no relevance here, so Value: Blank() will not do anything unless a field called Value is displayed in the Combo Box. 
    Are my assumptions correct or am I misreading something ?
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • futr_vision Profile Picture
    831 Moderator on at
    Issue with getting child combo box to show Parent.Default
     
    That first example is what I am using for my combo boxes. That works fine. It's the second child combo box that I am having issues with. It is not populated from a table but the values are hard coded.
     
    [1,2,3,4,5,6]
    If I inspect the code for the DeafultSelectedItems for that child combo box it looks like it is returning the correct value for Parent.Default as is evident by hovering on Parent.Default in the code. It's just not setting it as the selected value in the combo box itself. 
     
  • futr_vision Profile Picture
    831 Moderator on at
    Issue with getting child combo box to show Parent.Default
    I'm not sure if this is relevant but the values for these combo boxes are coming from the selected gallery item that is putting the record into a variable that is then being used for the Item property of the form. The value for {dk_emailsequencenumber: Parent.Default} exists in that variable. And as I mentioned earlier, I can see that value when I inspect the code for DefaultSelecetedItems. 
     
  • WarrenBelz Profile Picture
    152,811 Most Valuable Professional on at
    Issue with getting child combo box to show Parent.Default
    OK - I will go the other way if Value is the field displayed and (I assume) 'Sub Ledger Name' is a Choice field (if it is Text, you do not need .Value at the end)
    {
       Value:
       If(
          varResetSubLedgerReview, 
          Blank(),
          ThisItem.'Sub Ledger Name'.Value
       )
    }
     
  • futr_vision Profile Picture
    831 Moderator on at
    Issue with getting child combo box to show Parent.Default
    Hmm. I'm not dealing with the sub ledger combo box. That is just an example of one that is working. The child combo box, that has the issue is the emailsequencenumber combo box with the following Items property.
      
    [1,2,3,4,5,6]
    Using this for its DefaultSelectedItems does not populate the combo box with the value from the parent (data card)
     
    If(varResetEmailSequenceReview,{Value:Blank()}, {dk_emailsequencenumber: Parent.Default})
    Rolling over Parent.Default shows that there is a value there, but it is not rendering in the combo box

     
    I did a rough Copilot query and it gave me something about a datatype mismatch. I know that the Items property is a number but it gets written to a text field in the Dataverse table. As the image show above it is a text value that is returned. Could the issue be that the combo box is looking for a number?
  • WarrenBelz Profile Picture
    152,811 Most Valuable Professional on at
    Issue with getting child combo box to show Parent.Default
    This is the first time you have mentioned Dataverse - I was assuming SharePoint. If this is an Option Set, I will; leave this to others - I do not use Dataverse.

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

Coming soon: forum hierarchy changes

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard