cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
IAmTheAppUser
Level: Powered On

Split a string and store it into 2d collection

I have a string passed from flow. 

I can define the string passed from flow to powerapp to whatever format I want but the current format it below:

 

number/streetname/suburb/state/postcode|number/streetname/suburb/state/postcode|number/streetname/suburb/state/postcode

 

String Explanation:

- different addresses are separated by |

- different part of an address is separated by /

- There can be 20 of addresses (so 20 rows in the collection as the final result) but the format is the same.

 

Expected end result:

- different addresses is showing on different rows

- every row has 5 text block showing different parts of the address

 

Thanks for the help Smiley Happy

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Split a string and store it into 2d collection

Hi @IAmTheAppUser 

 

ForAll(Split(TextValue,"|"),Collect(dataLoad,{Number:First(Split(Result,"/")).Result,StreetNumber:Last(FirstN(Split(Result,"/"),2)).Result,Suburb:Last(FirstN(Split(Result,"/"),3)).Result,State:Last(FirstN(Split(Result,"/"),4)).Result,PostCode:Last(Split(Result,"/")).Result}))

 

 

TextValue - is the value returned from PowerApps

dataLoad - is the name of the collection

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

2 REPLIES 2
Super User
Super User

Re: Split a string and store it into 2d collection

Hi @IAmTheAppUser 

 

ForAll(Split(TextValue,"|"),Collect(dataLoad,{Number:First(Split(Result,"/")).Result,StreetNumber:Last(FirstN(Split(Result,"/"),2)).Result,Suburb:Last(FirstN(Split(Result,"/"),3)).Result,State:Last(FirstN(Split(Result,"/"),4)).Result,PostCode:Last(Split(Result,"/")).Result}))

 

 

TextValue - is the value returned from PowerApps

dataLoad - is the name of the collection

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

IAmTheAppUser
Level: Powered On

Re: Split a string and store it into 2d collection

Awesome! It worked. Thanks a lot !

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 428 members 5,280 guests
Please welcome our newest community members: