I have a combobox that pulls its choice values from a different SharePoint List based on selections made in another field. From this I have not been able to properly Concat the SelectedItems values into text. I have tried the option of
Concat(ComboBox1.SelectedItems, Value & ", ")
but this isn't working as the picture shows, the output is shown as "Result" not "Value". Doing the same Concat with "Result" also does not work.
Any ideas? Photos of my work below:
If(DataCardValue217.Selected.Value="SUPER GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Super Group Name','Corp Product Super Group Name'),If(DataCardValue217.Selected.Value="PRODUCT GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Group Name','Corp Product Group Name'),If(DataCardValue217.Selected.Value="SUB GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Sub-Group Name','Corp Product Sub-Group Name'),[""])))
Solved! Go to Solution.
@RandyHayes So that didn't exactly work either as I got an additional error message so I tried putting my solution attempt and yours together resulting in (replacing my "[""]" with your "{Result:""}":
If(DataCardValue217.Selected.Value="SUPER GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Super Group Name','Corp Product Super Group Name'),If(DataCardValue217.Selected.Value="PRODUCT GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Group Name','Corp Product Group Name'),If(DataCardValue217.Selected.Value="SUB GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Sub-Group Name','Corp Product Sub-Group Name'),{Result:""})))
And with a Concat function of
Concat(ComboBox1.SelectedItems,Result & "; ")
it is working perfectly now! Thank you so much for the help!
You are using the Distinct function in your items property. Therefore your records will have a single column called Result.
Change your formula to the following:
Concat(ComboBox1.SelectedItems, Result & ", ")
I hope this is helpful for you.
@RandyHayes Yes I gave that a try when I realized my output was going to be a "Result" with the Distinct function. The error I kept getting was "Name isn't valid. The identifier isn't recognized" on Result in the Concat function
So, let's get your Items property cleaned up so that PowerApps is not getting conflicting schemas.
Change your Items formula to the following:
If(IsBlank(DataCardValue217.Selected.Value),
{Result:""},
Distinct(
Filter('SOURCE', Title=Dropdown1.Selected.'Supplier Name'),
Switch(DataCardValue217.Selected.Value,
"SUPER GROUP", 'Corp Product Super Group Name',
"PRODUCT GROUP", 'Corp Product Group Name',
"SUB GROUP", 'Corp Product Sub-Group Name'
)
)
)
)
This will make sure that we are getting the same schema. Your original formula was returning a [""] if none of the conditions were met. When you do [""] you end up with a table that has a single column called Value with an empty value. Your Distinct functions are all going to return a table with a single columns called Result.
These type of things confuse PowerApps as it is not allowed - so best to keep the schemas consistent.
So, plug that in and then let's see where that leads us for the concat function.
@RandyHayes So that didn't exactly work either as I got an additional error message so I tried putting my solution attempt and yours together resulting in (replacing my "[""]" with your "{Result:""}":
If(DataCardValue217.Selected.Value="SUPER GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Super Group Name','Corp Product Super Group Name'),If(DataCardValue217.Selected.Value="PRODUCT GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Group Name','Corp Product Group Name'),If(DataCardValue217.Selected.Value="SUB GROUP",Distinct(Filter('SOURCE',Title=Dropdown1.Selected.'Supplier Name').'Corp Product Sub-Group Name','Corp Product Sub-Group Name'),{Result:""})))
And with a Concat function of
Concat(ComboBox1.SelectedItems,Result & "; ")
it is working perfectly now! Thank you so much for the help!
Disregard: user error
In the case that the Items for the combo box items are derived from a list defined in the app, how would you refer to it?
my combo box items are equal to:
Items = [BrowseGallery.Selected.Field1, BrowseGallery.Selected.Field2]
I've tried using 'Result' , 'Value', 'Item', and 'Items' in place of 'Result' as shown in your solution but none of these work. Since there is no column name, how should the items be referred to, to get the selected items converted to text?
If that is your items property, then it is a table with a single column called Value.
Any time you use the square bracket table shortcut, it will create a table with a single column called Value.
If you are having issues with what you are using, then first, I'd recommend putting in a new post on the forum with the problem, and in it, describe what Field1 and Field2 are in your gallery.
User | Count |
---|---|
257 | |
110 | |
97 | |
52 | |
39 |