cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Generate a collection from CSV format data sent from flow - string format is below - needs a formula for splitting them

String format:

streetNumber,streetName,Suburb,Postcode,State,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx,xxxxx

 

The above string is the format parsed from Flow to Powerapps. I want to be able to turn it into a collection.

 

The first five comma separated values would be the title. The rest of the comma separted values would be sequentially matched to each title which is represented by 'xxxxx' in the string. In the above string, there are 15 'xxxxx' which indicates that there are three addresses returned from Flow to Powerapps.

 

I want to be able to split them so that I can show them in a collection with 5 heading at the beginning of the string.

 

Thanks for the help 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User II
Dual Super User II

Hi @IAmTheAppUser 

 

If you have license to use Premium connectors, then you can directly use the Response action to send JSON to PowerApps. This can be collected in a collection using ClearCollect(CollectionName,FowName.Run())
Once you make any changes to the flow, you need to remove it and register it again to the canvas app.
 
If you do not have license for premium connectors then you can use below expressions:
Clear(MyCollection);With({Loops:(CountRows(Split(Label1.Text,","))/5)-1},ForAll(FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],Loops),Collect(MyCollection,{streetNumber:Last(FirstN(Split(Label1.Text,","),Value+5)).Result,streetName:Last(FirstN(Split(Label1.Text,","),Value+6)).Result,Suburb:Last(FirstN(Split(Label1.Text,","),Value+7)).Result,Postcode:Last(FirstN(Split(Label1.Text,","),Value+8)).Result,State:Last(FirstN(Split(Label1.Text,","),Value+9)).Result}))) 
 
Note: We cannot pass variable the keys for name of columns in collections, hence this needs to be harcoded. Here, you need to replace Label1.Text with the value that holds this returned string.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
Dual Super User II
Dual Super User II

Hi @IAmTheAppUser 

 

If you have license to use Premium connectors, then you can directly use the Response action to send JSON to PowerApps. This can be collected in a collection using ClearCollect(CollectionName,FowName.Run())
Once you make any changes to the flow, you need to remove it and register it again to the canvas app.
 
If you do not have license for premium connectors then you can use below expressions:
Clear(MyCollection);With({Loops:(CountRows(Split(Label1.Text,","))/5)-1},ForAll(FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],Loops),Collect(MyCollection,{streetNumber:Last(FirstN(Split(Label1.Text,","),Value+5)).Result,streetName:Last(FirstN(Split(Label1.Text,","),Value+6)).Result,Suburb:Last(FirstN(Split(Label1.Text,","),Value+7)).Result,Postcode:Last(FirstN(Split(Label1.Text,","),Value+8)).Result,State:Last(FirstN(Split(Label1.Text,","),Value+9)).Result}))) 
 
Note: We cannot pass variable the keys for name of columns in collections, hence this needs to be harcoded. Here, you need to replace Label1.Text with the value that holds this returned string.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Hi Yashag2255

 

The functionality of my app gets the files name in one drive. Then the user selects the file name in the app. The app then triggers the flow to get the file content.

 

Is there any way in Flow to parse the data in the user selected file into Json? If there is one, I could just parse the data from the file as Json, else, I would have to trigger a Azure function in flow that sorts the format of the data.

 

Thanks for help 🙂

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,220)