cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Englishweb Post Patron
Post Patron

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hello @v-xida-msft 

Thank you for taking the time to reply. It is working quite well now, thanks.

Still having an issue with the combo box; the DefaultSelectedItems and Default properties are both blank , which could explain why I'm getting the same name appearing in the combo box afer save. What should I add to the combobox defaults?

If someone accidently clicks Save with nothing selected in the combo box this clears the last data entry - is there a way to avoid this happening?

The Save button also includes a ClearCollect , Patch and UpdateContext

);UpdateContext({LetsEdit: false })
;Set(ShowSavedValue, true) Could these be conflicting with each other?

Thanks in advance for any suggestions

Community Support
Community Support

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hi @Englishweb ,

Could you please share a bit more about the issue with your ComboBox?

 

If you want to set a default value within the ComboBox control, please specify your value within the DefaultSelectedItems property rather than the Default property.

 

For your first question, I think this issue is related to that you could not reset your ComboBox after you save your data. Please consider add the following formula within the OnSelect property of the "Save" button:

Patch(...);
Set(ShowSavedValue, true);
Reset(S1Combo) /* <-- Add this formula */

After saving your data, please reset your ComboBox control.

 

For your second question, have you turned on the "Formula-level error management" option within Advanced settings of App settings of your app?

If you have turned on the "Formula-level error management" option within Advanced settings of App settings of your app, when you save the ComboBox data (no selection, Blank value) back to the corresponding column in your data source, it would clear the original value within the corresponding column.

Please take a try to turn off the "Formula-level error management" option within Advanced settings of App settings of your app, then try your formula again, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Englishweb Post Patron
Post Patron

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hello @Kris Dai

Thanks for your reply.

Your solution clears the combobox AND all the fields being populated by the combobox selection. I'm looking for a solution which clears the combobox selection but keeps the last saved fields. I presume this has to be in the DefaultSelectedItems property, rather than in the OnSelect property of the Save button?

I've checked that the Formula-level error management option is off.

I hope my attempt to describe this issue is clear!

Community Support
Community Support

Re: How to set default properties to "ThisItem"on label which is being populated by combo box selection

Hi @Englishweb ,

Do you want the latest entry you submitted to be act as Default value within the ComboBox after you submit your data?

Do you store the vaue into the Student1 column in your Excel table as SurNameA FirstNameA,SurNameB FirstNameB, ...?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the DefaultSelectedItems property of the ComboBox to following:

 

ForAll(
          Split(ThisItem.Student1, ","),
          {
             PRENOM: First(Split(Result, " ")).Result
          }
)

Add the following formula within the OnSelect property of the "Save" button:

Patch(...);
Set(ShowSavedValue, true);
Reset(S1Combo) /* <-- add this formula here to Reset your ComboBox control */

 

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,861)