cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JMerk
Frequent Visitor

Combo Box dynamic default content

Hey there, I'm having some issues getting the default of some combo boxes to populate.  The user of the app might have to submit multiple forms, with some of the information staying consistent between submissions. 

 

To help speed up the process, I was hoping to store some of the information in variables when they hit the submit button and then automatically be selected again after the form refreshes.  I'm able to verify the variables are holding the correct info, and I can get the information to pop up in the combo box, but the actual value of the combo box is blank because, on submission, the database is receiving blank values.  

 

What can I do to fix this?  Thanks for the help!

5 REPLIES 5
NandiniBhagya20
Solution Sage
Solution Sage

Hi,
Could you please share the current formulas that you are using 


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

This is the OnSelect property on the submit button.

UpdateContext({farmCombo: DataCardValue45.Selected.Result});

Set(
fieldCombo,
DataCardValue46.Selected.Field
);
If(
Value(DataCardValue1.Text) in HarvestTickets.HVTTicketNumber,
Notify(
"Duplicate Ticket Number Detected, Please Double Check!",
Error
),
Set(
varDuplicate,
true
) && SubmitForm(Form3) && NewForm(Form3)
);

 The reason I have two methods of setting a variable was just an effort to try different things.

 

The DefaultSelectedItems Property of the first ComboBox is: 

[farmCombo]

 And for the other one,

[fieldCombo]

 

NandiniBhagya20
Solution Sage
Solution Sage

UpdateContext({farmCombo: DataCardValue45.Selected.Result});

Set(
fieldCombo,
DataCardValue46.Selected.Field
);
If(
Value(DataCardValue1.Text) in HarvestTickets.HVTTicketNumber,
Notify(
"Duplicate Ticket Number Detected, Please Double Check!",
Error
);
Set(
varDuplicate,
true
) , SubmitForm(Form3) ; NewForm(Form3)
);

Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

It's still doing the same thing, in the ComboBox, it looks like the correct item is selected as it's showing up in the box.  However, the Data Card Value is still blank.

JMerk
Frequent Visitor

Alright, I got one of the combo boxes to be updated, the DefaultSelectedItems property looks like so: 

LookUp(HVTCropDetails, Field = fieldCombo)

The items inside of the second combo box is reliant on whatever the user selects in the first box, selected like so:  

Sort(Filter(HVTCropDetails, FarmName = ComboBox2.Selected.Result), Field)

 The first ComboBox is still not using the variable information for the DefaultSelectedItems property.  If I filter the items using

[TableName].[ColumnName]

 it works just fine.  However, there are a lot of duplicate values in this selection which is why I would like to use the Distinct function.  However, when I use it, it won't utilize the DefaultSelectedItems property and insert the variable's data.  

 

To reiterate, the problem arises when I use the Distinct functionality.  Is there another way of filtering unique items?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,290)