cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MrEdward
Helper I
Helper I

Combo Box default values from two other combo boxes

Hey everyone,

 

I'm having trouble setting the default value for a combo box that pulls from two other combo boxes.. 
This is what I have:

combo1.png

That works if there's only 1 of the combo box but i need to also pull the value from another combo box.

I tried doing:

DataCardValue2.SelectedItems.DisplayName & DataCardValue16.SelectedItems.DisplayName

but that doesn't work and doesn't make sense... 

anyone got an idea?

 

Thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

@MrEdward 

 

The previous solution didn't work because it was designed for text type fields, for person or group type column, we will have to add a collection. Can you try to update the configuration to:

 

DataCardValue2 & DataCardValue16 (Add this same formula to both controls)-> OnChange -> Clear(CombinedCollection);ForAll(DataCardValue2.SelectedItems,Collect(CombinedCollection,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & ThisRecord.Email,
Department:"",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Email,
JobTitle:"",
Picture:""
}));ForAll(DataCardValue16.SelectedItems,Collect(CombinedCollection,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & ThisRecord.Email,
Department:"",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Email,
JobTitle:"",
Picture:""
}));Reset(ComboBox1)

 

Combobox1 -> DefaultSelectedItems -> CombinedCollection

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
yashag2255
Dual Super User II
Dual Super User II

Hi @MrEdward 

 

Can you share more details about the logical implementation using the both comboboxes? "&" is used for concatenation. If you can share more details, we will be able to help you better.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi @yashag2255 ,

 

What I'm trying to do is have the default value of ComboBox1 based on the selection of ComboxBox2 and ComboBox3.

For example:

ComboBox2 selects David and John

ComboBox3 selects Peter and Dawn

 

ComboBox1's default value will be David, John, Peter, and Dawn.

 

All these combo boxes are people/group field.

 

yashag2255
Dual Super User II
Dual Super User II

@MrEdward 

 

In that case, you can set the "DefaultSelectedItems" property of the first combobox to:

Filter(["David","John","Peter","Dawn"],Or(Value in ComboBox3.SelectedItems.Value, Value in ComboBox4.SelectedItems.Value))

Here, you need to replace ["David","John","Peter","Dawn"] with the value in Items property of the Combobox1 control.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Humm that didn't work for me..

Here's my code for ComboBox1 on Defaultselecteditems:

Filter('Site Provisioning'.Owners, Or(DisplayName in DataCardValue2.SelectedItems.DisplayName, DisplayName in DataCardValue16.SelectedItems.DisplayName))

Site Provisioning is a SharePoint List and ".Owners" is a Column on that list that is "People and Groups" type of column.

yashag2255
Dual Super User II
Dual Super User II

@MrEdward 

 

The previous solution didn't work because it was designed for text type fields, for person or group type column, we will have to add a collection. Can you try to update the configuration to:

 

DataCardValue2 & DataCardValue16 (Add this same formula to both controls)-> OnChange -> Clear(CombinedCollection);ForAll(DataCardValue2.SelectedItems,Collect(CombinedCollection,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & ThisRecord.Email,
Department:"",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Email,
JobTitle:"",
Picture:""
}));ForAll(DataCardValue16.SelectedItems,Collect(CombinedCollection,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & ThisRecord.Email,
Department:"",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Email,
JobTitle:"",
Picture:""
}));Reset(ComboBox1)

 

Combobox1 -> DefaultSelectedItems -> CombinedCollection

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Thanks @yashag2255 

Didn't think of that method, works great!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (66,536)