cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

how to concatanate label values with semicolon

Hello Everyone,

 

I am new to PowerApps and unable to determine right solution on how to concatenate collection input text lables with Semicolon and save it to a SharePoint text column. 

 

Requirement: I want to show "Text input" label whenever users selects a button and each "Text input" will allow users to enter content into that. Based up on this I want to combine all the Text input labels along with "Semicolon" in between and the save it back to SharePoint text column. 

1. onVisible property of the screen- ClearCollect(ItemsCollection,0)

2. I have a button with these configurations - Collect(ItemsCollection, {column1:TextInput1.Text})

3. Gallery "items" property - ItemsCollection

 

Powerapps.PNG

 

 

 

 

My question is, how can I collect all the text input details and save to collection and then how can I save it to SharePoint text column adding "Semicolon"  in between those text input labels. 

8 REPLIES 8
eka24
Super User
Super User

On button that collect the data into the collection:

Collect(Collection1, {Names:TextInput5_4.Text&";"&TextInput5_5.Text&";"&TextInput5_1.Text})
 
Then Patch to Sharepoint:

ForAll(Collection1, Patch(Datasource,Defaults(Datasource),

{Names:Names}))

------------

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

RezaDorrani
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

Once you have all your data in the collection.

Use the Concat function to get your values seperated by semicolon in a single text field

 

To get all text values in collection with ; seperated

Concat(ItemsCollection,column1&";")

 

To remove the last ; use below:

Left(Concat(ItemsCollection,column1&";"),Len(Concat(ItemsCollection,column1&";"))-1)

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

Anonymous
Not applicable

@eka24Thanks for your reply. Because users can add several Text input labels dynamically, I don't think so I can mention right text input labels while collecting details right? 

 

Ex: Collect(Collection1, {Names:TextInput5_4.Text&";"&TextInput5_5.Text&";"&TextInput5_1.Text}), here I won't know whether users selected textinput1 or textinput10 or 20 items. How can collect values dynamically based up on number textinput labels that user adds? 

Anonymous
Not applicable

@RezaDorrani, thanks for your reply. SO I can use below code on "button" of "Onselect property" right? And below code will collect content for how many labels user selects? Like example users can click on button to add may be 3 inputtext labels or sometimes they can select 10 and so on. 

 

Left(Concat(ItemsCollection,column1&";"),Len(Concat(ItemsCollection,column1&";"))-1)

Your initial request you showed had 3 textboxes. So the response was based on your request.

I dont understand the Dynamic example you gave. Cant you add the other textboxes into the formula?

------------

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

Anonymous
Not applicable

@eka24, I meant to say, whenever I select "select this button to add channel" , it will give me additional input Text label so that I can add content, like wise I can several text label to add additional channel names. 

The formula is still valid. If they are 10 textboxes, you have to add to the formula

 

------------

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

Anonymous
Not applicable

@eka24, I might be wrong and sorry for asking again and again. How do I know if there are 10 text labels or 1 label? Because can click on the button for 5 time or 6 or 10 times. So it is not static, which means can I hardcode this coding ahead without knowing the exact text input labels? 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Top Solution Authors
Top Kudoed Authors
Users online (4,004)