How can I pass the multiple selected items to Update, so that final result would be a text field as follows:
"Item1; Item2; Item6" ?
Can I also read it back as "DefaultSelectedItems = [ThisItem.MyField]" ?
PS.
I use a text type for that field because I don't know the possible choices as they may vary in time.
Thank you for any help.
Try changing your Update property for that datacard to the following formula:
Concat(ComboBox.SelectedItems, Result & ";")
That will give you the concatenated list with semicolon separation. Keep in mind that this will end with a semicolon. (i.e. "Item1; Item2; Item6;")
If you wish to exclude that you can change your formula to the following:
Left(Concat(ComboBox.SelectedItems, Result & ";"), Len(Concat(ComboBox.SelectedItems, Result & ";"))-1)
This will perform the concat twice, once to get the length and the other to trim it by 1 (the trailing semicolon).
If you want, you can also use the With function for this - change formula to the following:
With({cList: Concat(ComboBox.SelectedItems, Result & ";")},
Left(cList, Len(cList)-1)
)
All of the above should give you what you are looking for.
I hope this is helpful for you.
Hi, I'm trying something similar;
I have one variable Set(_Fechas,"") where I want to store days of the month like "01;02;03;...."
I have a text label with _Fechas on it's Item property.
But whenever I try to patch the SelectedItems Table to a String variable using this formula, I got an error that says:
"Issue: Invalid argument type. Expecting one of the following: Text, Number, Boolean, OptionSetValue, ViewValue"
Any idea?
The properties you named don't make sense as things like text labels don't have Items properties.
Perhaps supply the formula you are having problems with and the property and control you are putting it in?
I mean, I have a Combobox with multiple value available for selection; numbers from 01 to 31. I want to allow my users to pick as much numbers as they want from the ComboBox; BUT I will store them all together in a Sharepoint List as a single-line field.
I am struggling trying to put all the values selected on the ComboBox into a single variable (for the purpose I had been trying to store the ComboBox.SelectedItems inside a Set variable; which also work as the Item for another field on the EditForm.
Hope to make myself clearer this time.
You don't need a variable for this in any way.
Just use this formula in your Update property of the form for the column you are setting:
Concat(yourCombobox.SelectedItems, Value & ";")
For the DefaultSelectedItems property of the combobox, set the formula to:
RenameColumns(Filter(Split(ThisItem.yourColumnName, ";"), !IsBlank(Result)), "Result", "Value")
Thanks, worked.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
164 | |
94 | |
64 | |
60 | |
60 |
User | Count |
---|---|
243 | |
163 | |
94 | |
84 | |
82 |