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

Splitting range of array with index - start and end index

Hi,

 

I have a array of values like below one,

 

M0524R0018
M0108R0018
M0536R0018
M0104R0018
M0106R0018

 

I need to split this into two array

Array 1

M0524R0018
M0108R0018
M0536

R0018

Array 2

M0104R0018
M0106R0018

 

This will be dynamic in each run so I have to pass start and end index in the expression. Whether someone have answer for this ?

5 REPLIES 5
Akshaya
Frequent Visitor

Please someone suggest me with any answer

 

Akshaya
Frequent Visitor

This is little bit critical for me so If someone have a solution please share

majorfriend
Helper III
Helper III

Try a compose action with :

indexOf(outputs("YOUR ARRAY")?['body'],'M0104')
Then split in another compose action with:
substring(outputs("YOUR ARRAY")?['body'],outputs('COMPOSE STEP FROM ABOVE'))

@majorfriend 

Tried to apply the approach you suggested but it throws a error

Akshaya_0-1623225256416.png

 

You should be able to convert the array to a string using the method described here:
How to convert array to a string in Power Automate (tomriha.com)

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,892)