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

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 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

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

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User II
Dual Super User II

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

View solution in original post

Highlighted
Frequent Visitor

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

Awesome! It worked. Thanks a lot !

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,898)