cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lesotho_kid
Helper II
Helper II

Update formula when trying to write all values of a multi-select combo box

Hello,

 

I have a multi-select combo box called "cmbTaxContacts". 
I want to write the results of that combo box into the database.  Ok if there are multiple results concatenated - i.e. "John Smith; Sally Jones; Jane Doe"
What does the Update formula of the card (which contains this combo box) need to be?  
Trying:

cmbTaxContacts.SelectedItems

But getting an error.
Appreciate any assistance you can provide.
 
Thanks,
Dan
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @lesotho_kid ,

You just need

Concat(
   cmbTaxContacts.SelectedItems, 
   DisplayName & ","
)

 

Please click Accept as solution 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 Thumbs Up.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @lesotho_kid ,

This depends on what type of field you are writing back to in the data and the Items of your drop-down. For a Choice Field in the data and the combo box source Choices(something) 

{Value:Concat(cmbTaxContacts.SelectedItems, Value & ",")}

There are a whole lot of other possibilities depending on these two things.

 

Please click Accept as solution 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 Thumbs Up.

 

Thanks @WarrenBelz 

 

I'm writing back to a SQL Server VARCHAR field.  And the values are regular text fields.
Tried setting Update =

{Value:Concat(cmbTaxContacts.SelectedItems, Value & ",")}
 
But getting an error saying 'Expect Text value.'
 
You've helped me with several other questions before.  Always appreciate your help.
 
Thanks,
Dan

Hi @lesotho_kid ,

Yes it will as my example was back to a complex field type.

You simply need

Concat(cmbTaxContacts.SelectedItems, xxxx & ",")

where xxxx depends on the Items property of the control.

When you type YourControlName.Selected. (note second dot), valid values will come up underneath. For some guidance of what they mean: -

  • If your Items are Choices(ListName.FieldName) - a Choices or Lookup field), the reference will be YourControlName.Selected.Value
  • If they are Distinct( . . .  .), it will be YourControlName.Selected.Result
  • The other option is when they are based on a field value in a list (other than Distinct), then it will be YourControlName.Selected.FieldName (actual field name)

 

Please click Accept as solution 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 Thumbs Up.

Thanks @WarrenBelz - appreciate the detailed answer.  The code is now not throwing errors.  But, when I run it and load to db it does not load the correct data.  It will load the first selected item n times - where n is the number of selections by the user.  i.e.  If user selects: John Smith, Mary Jones, Jane Doe.  Then the db will display John Smith, John Smith, John Smith.  Update code below.

Thanks,

Dan

Concat(cmbTaxContacts.SelectedItems, cmbTaxContacts.Selected.DisplayName & ",")

 

Hi @lesotho_kid ,

You just need

Concat(
   cmbTaxContacts.SelectedItems, 
   DisplayName & ","
)

 

Please click Accept as solution 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 Thumbs Up.

View solution in original post

Thanks @WarrenBelz 

You are a Power Apps wiz!

 

Thanks for your help!

Dan

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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