I am using a dropdown field for filtering purposes within a list. I have a multi choice dropdown list created by a split function, from previous selections, and I want to eliminate the user's ability to select items, and just keep the selection as all possible choices from the dropdown. Thanks for your help 🙂
Solved! Go to Solution.
Hi @egornau ,
Could you please show more details about the formula you typed within the DefaultSelectedItems property of the ComboBox?
Based on the needs that you mentioned, I think the Split function is in right direction. I have made a test on my side, please take a try with the following workaround:
Set the Items property of the ComboBox to following:
Split(
If('Dropdown1'.Visible, 'Dropdown1'.Selected.Name & "; ","") & If('Dropdown2'.Visible,'Dropdown2'.Selected.Name & "; ","") & If('Dropdown3'.Visible, 'Dropdown3'.Selected.Name & "; ","") & If('Dropdown4'.Visible,'Dropdown4'.Selected.Name & "; ", ""),
"; "
)
Set the DefaultSelectedItems property of this ComboBox to following:
ForAll(
Split(
If('Dropdown1'.Visible, 'Dropdown1'.Selected.Name & "; ","") & If('Dropdown2'.Visible,'Dropdown2'.Selected.Name & "; ","") & If('Dropdown3'.Visible, 'Dropdown3'.Selected.Name & "; ","") & If('Dropdown4'.Visible,'Dropdown4'.Selected.Name & "; ", ""),
"; "
),
{
Result: Result
}
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
To do this you would simply put the same code in the DefaultSelectedItems property as the Items property.
Example:
Items:
ComboBoxSample
DefaultSelectedItems:
ComboBoxSample
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi @mdevaney, thank you for your response. My Items property code is the below:
Split(If('Dropdown1'.Visible, 'Dropdown1'.Selected.Name & "; ","") & If('Dropdown2'.Visible,'Dropdown2'.Selected.Name & "; ","") & If('Dropdown3'.Visible, 'Dropdown3'.Selected.Name & "; ","") & If('Dropdown4'.Visible,'Dropdown4'.Selected.Name & "; ", ""),"; ")
I tried putting this into DefaultSelectedItems property, but it still doesn't populate it automatically, any ideas?
One thing to note is if you've already changed the values manually in the ComboBox it won't show the default values anymore. You'll have to reset it the ComboBox.
If that fails, try putting the result of your code into a collection instead.
ClearCollect(
myComboBoxOptions,
Split(If('Dropdown1'.Visible, 'Dropdown1'.Selected.Name & "; ","") & If('Dropdown2'.Visible,'Dropdown2'.Selected.Name & "; ","") & If('Dropdown3'.Visible, 'Dropdown3'.Selected.Name & "; ","") & If('Dropdown4'.Visible,'Dropdown4'.Selected.Name & "; ", ""),"; ")
)
Then use the same collection in the Items property and DefaultSelectedItems
myComboBoxOptions
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Huh, I guess in my case ComboBox is not the right solution then, if the default values are only set on opening of the form, I need them to update conditionally based on output of other DropDowns, which may or may not be on the form, depending on another ComboBox.
I have managed to output the desired info into a string, with the following code:
If('Dropdown1'.Visible, 'Dropdown1'.Selected.Name & "; ","") & If('Dropdown2'.Visible,'Dropdown2'.Selected.Name & "; ","") & If('Dropdown3'.Visible, 'Dropdown3'.Selected.Name & "; ","") & If('Dropdown4'.Visible,'Dropdown4'.Selected.Name & "; ", "")
So the output is "Option 1; Option 2; Option 4", for example, but I want the SharePoint list users to be able to filter out, for example just to see Option 2 items, hence the idea was to use Split and then output as a ComboBox for easy grouping/filtering. Is there a better way to do this?
Again, thanks for all your help.
Hi @egornau ,
Could you please show more details about the formula you typed within the DefaultSelectedItems property of the ComboBox?
Based on the needs that you mentioned, I think the Split function is in right direction. I have made a test on my side, please take a try with the following workaround:
Set the Items property of the ComboBox to following:
Split(
If('Dropdown1'.Visible, 'Dropdown1'.Selected.Name & "; ","") & If('Dropdown2'.Visible,'Dropdown2'.Selected.Name & "; ","") & If('Dropdown3'.Visible, 'Dropdown3'.Selected.Name & "; ","") & If('Dropdown4'.Visible,'Dropdown4'.Selected.Name & "; ", ""),
"; "
)
Set the DefaultSelectedItems property of this ComboBox to following:
ForAll(
Split(
If('Dropdown1'.Visible, 'Dropdown1'.Selected.Name & "; ","") & If('Dropdown2'.Visible,'Dropdown2'.Selected.Name & "; ","") & If('Dropdown3'.Visible, 'Dropdown3'.Selected.Name & "; ","") & If('Dropdown4'.Visible,'Dropdown4'.Selected.Name & "; ", ""),
"; "
),
{
Result: Result
}
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
User | Count |
---|---|
176 | |
111 | |
86 | |
44 | |
42 |
User | Count |
---|---|
228 | |
116 | |
115 | |
72 | |
67 |