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

Concat contents of a List Box to a String

Hi

I'm trying to concat the contents of a list box (listbox1) to a string. I hope to use the string as a parameter in a Run() which will be a trigger for Power Automate to send an email.

 

I'm using this code Concat(listbox1.SelectedItemsText.Value, Concatenate(Text(Value),";")) within OnSelect (should it be On Select? or Text)

 

Although there does not appear to be any errors this does not return the resulting concatenated string. 

 

Can anyone help with this please?

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

If this works you might change it like this to remove that last ";"

 

Left(Concat(Distinct(Filter('IDL Email List', Title in ListBoxOfFunctions.SelectedItems.Result), EmailString), Result & ";"), Len(Concat(Distinct(Filter('IDL Email List', Title in ListBoxOfFunctions.SelectedItems.Result), EmailString), Result & ";")) -1)


If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

30 REPLIES 30
JR-BejeweledOne
Super User
Super User

Typically you would use it in a text property.   Maybe have a hidden label that you use it in and then use the value of the label in your Flow.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
LyndaSlessor
Helper I
Helper I

@JR-BejeweledOne Thank you very much for the quick reply.

 

I have tried that and the outcome is a message to say We didn't find any data when I click on .Value - there are two email addresses in listbox1 that display correctly on screen but they won't concat into my hidden label

 

I feel I must be missing something silly....

 

 

JR-BejeweledOne
Super User
Super User

I have a data source that has an email column in it.  I put my items in a listbox and this is the formula I used successfully to concat the items.

 

Concat(ListBox1.SelectedItems.Email, Concatenate(Email, ";"))


If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
gabibalaban
Dual Super User
Dual Super User

@LyndaSlessor ,

Use:

 

Concat(
     listbox1.SelectedItems,
      Value&";"
)

 

it should be enough ...

Hope it helps !

Hi @LyndaSlessor,

Check as below:

Concat(ListBox1.SelectedItems,Value,";")
Best Regards,
Qi
LyndaSlessor
Helper I
Helper I

Thank you all very much for your suggestions

 @JR-BejeweledOne - @gabibalaban - @v-qiaqi-msft 

Unfortunately none of these are giving me any results and I'm still getting the message 'We didn't find any data'.  I know my listbox has data as it's displayed in the listbox.

 

I have a listbox and a label:

ListBox1 has a Filter that compares the values in an SP List column and displays the email addresses from one of the other columns (this is not a Person/Group column, just a string of email addresses separated with a semicolon. I know I should use the Person/Group type but I'm new to Power Apps and don't know enough yet to work out how to use that  😓)

Label1 which I'm using to concatenate the email addresses from ListBox1. The code Concat(ListBox1.SelectedItemsText, Value, ";") in the Text property of the label doesn't throw up any errors and seems happy enough, but when I click SelectedItemsText it comes up with the 'didn't find any data' message.

 

Could the problem be with ListBox1 do you think?

JR-BejeweledOne
Super User
Super User

What is your items property on your list box?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
LyndaSlessor
Helper I
Helper I

@JR-BejeweledOne Here it is...

Distinct(Filter('SP List', Title in ListBoxFunctions.SelectedItems.Result), Label1)

 

ListBoxFunctions is another listbox of values, the Filter matches the values in the SP List Title column and the selected values from the ListBox.

 

 

 

 

 

JR-BejeweledOne
Super User
Super User

Try this:

Concat(
     listbox1.SelectedItems,
      Result&";"
)


If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,402)