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 / Clear DefaultSelectedi...
Power Apps
Answered

Clear DefaultSelecteditems of a ComboBox When Selection Changes. Assume this would be in OnChange Event?

(0) ShareShare
ReportReport
Posted on by 25

Form is for Editing a Matter 

The form's Default mode is edit. The Forms Item property is set to the Selected Gallery Item...GalMatters.Selected

There are a serires of datacards that are foreign keys in a table

 

Here is an example of one of the Data Cards.

 

This is for Probation Officers

 

The DataCard field  is a foreign key in the form's table...tblMtr.  The field is MtrPro1

The DataCardValue's Default Value is set to a combo box selected item.....cmboMtrEditPro.Selected.ProID

The ComboBox Default selected items is set to the DataCard fields value Filter('[dbo].[tblPro]',proID = MtrPro1)

 

Accordingly, When Someone selects a matter in the GalMatter Gallery the Edit form populates the combo boxes with the record corresponding with the foreign key.   

 

All well and good.  The rub is when you want to change the selection from Probation officer Joe Smith to Jane Doe.  When you submit the form the Default for the DataCard goes back to the DefaultSelectedItems.  

 

Its essentially circular.  Is there a method for the OnChange event that would clear the DefaultSelectedItems for the combo box. 

 

 

Categories:
I have the same question (0)
  • tflynn5005 Profile Picture
    25 on at

    UPDATE*****

    Correction this works as designed.  YOu can change to Jane Doe.  The hang up is when you want to change the assignement to a null i.e. no assinged Probation Officer.  It reverts back to the default.  So how do you write a Null to the SQL AZURE table??? the columns property in SQL Azure Allow Nulls is set to yes so it is not a back end issue.  I'm Stumped.  

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @tflynn5005 ,

    Do you want to write a null value to a foreign key field?

    Could you describe more clearly about the field's name?

    I assume that the form is binding with the tblMtr table, MtrPro1 is the foreign key.

                           the other table's name is tblPro, proID is the primary key.

    Sine the primary key can't be null value, so you can't filter a record if the MtrPro1 is null value by using this formula: Filter('[dbo].[tblPro]',proID = MtrPro1)

     

    I suggest you use the if statement.

    If(IsBlank(assignement.Text),[],Filter('[dbo].[tblPro]',proID = MtrPro1))

     

    Best regards,

    Community Support Team _ Phoebe Liu

     

  • Community Power Platform Member Profile Picture
    on at

    Hi @tflynn5005 can you review the above reply and update the thread if it was helpful? 

     

    Thank you,

     

    @Anonymous 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard