cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Gaëlle
Level 8

Getting SP items and split each item's string

Hello there !

I've seen a lot of solutions for splitting string and then applying foreach, but i haven't seen the way around.

Explanations :

I'm getting ItemS from Sharepoint (depending on their departure date), and for each of them, I have a string called PassengersMails, which is like the following : "email1@XXX.com;email2.XXX.com;email3.XXX.com".

i already have a foreach on the Value of GetItems.

In it, i already have a condition on If PassengersMails is empty.

Now in the No of the condition, i would like to split the PassengersMails string to an array. For each item in this array, I want to retrieve the Passenger's Display Name (using a O365Users connection) and to store it in a new string.

 

I can't figure out how to proceed.

How to split a string from a foreach Value ?

 

Thanks a lot, have a nice day.

5 REPLIES 5
Willemijn
Level 8

Re: Getting SP items and split each item's string

Hi!

 

If you have a common delimiter you could use the split expression maybe? 

I have tested it wit a variable with two e-mailadresses in it, and then an apply to each where the input is the splitted version of that variable (for you it's your string from your previous action):

image.png

 

Hope this helps, otherwise let me know I will check again :-)

Willemijn
Level 8

Re: Getting SP items and split each item's string

Hi @Gaëlle !

 

Did this solve your problem, or do you need any other help? 

Otherwise could you mark the answer as solution?

 

Regards,

Willemijn

George_Emmanuel
Level: Power Up

Re: Getting SP items and split each item's string

Hi @Willemijn , how do I traverse the string using built-in API's in MS Flow?

 

Apologies as I'm very new to this..

Right now, what I can do is use the first() and last() functions, but this limits me to only 2 inputs..

I want to get the values per index such as..

 

name = splitString[0];

address = splitString[1];

Willemijn
Level 8

Re: Getting SP items and split each item's string

Hi, 

 

Do you have an example with sample data of the string you would want to split and what the expected outcome is? 

Then I can take a look.

 

Willemijn

George_Emmanuel
Level: Power Up

Re: Getting SP items and split each item's string

Thank you for the quick reply..

 

I will try this first.

https://powerusers.microsoft.com/t5/Building-Flows/Accessing-Array-elements/m-p/62508#M5787

 

I think this is what I need. I'll get back when I'm stuck..

 

Thanks again!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand 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.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 209 members 4,386 guests
Recent signins:
Please welcome our newest community members: