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

Using split() or substring() inside Apply to Each - Dynamic content disappearing

I'm trying to use split() inside an Apply to Each loop. I create a compose action and can populate the field with the dynamic content. As soon as i try to enter an expression with split() or substring(), I am unable to use the dynamic content. Why is that? Do you guys have any ideas around it? 

 

without split()

PhilDevXX_0-1600098206228.png

 

  With split()

PhilDevXX_1-1600098286559.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

As soon as you enter the Split() or Substring() you are explicitly specifying that the dynamic content must be a string.  So its filtering out everything that isn't a string.  Is there a specific field that you want?  Are you sure its a string?

 

The workaround I normally use is to use two compose statements.  One to get the original dyanmic content I want to use and the second to do the split or substring.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

As soon as you enter the Split() or Substring() you are explicitly specifying that the dynamic content must be a string.  So its filtering out everything that isn't a string.  Is there a specific field that you want?  Are you sure its a string?

 

The workaround I normally use is to use two compose statements.  One to get the original dyanmic content I want to use and the second to do the split or substring.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

eliotcole
Helper V
Helper V

I'm not able to fully look at this right now due to current issues in UK South ... but have you tried breaking this down a bit more in the flow and working the split as a full on array?

OK, I actually did re-read, and get a look at your images, and it's not quite clear what you're splitting in the first place.

 

So, what I do (even when I'm just trying to get a bit of text sometimes as I prefer the logic) is have an array variable already initialised, then I split the text to set that array.

 

So for this one I am working with a list of comics:

Comic One #1

Comic Two #4 (of 5)

Comic Three #14

 

I split that list, first:

Split on a carriage returnSplit on a carriage return

So far, a conventional array,

 

So now I have distinctly accessible data in the array. Then on an apply to each for each array item, I split them again but on the '#' ... since I know that each issue in the list at least has that #.

 

Further processing using array and string variablesFurther processing using array and string variables

 

 

From there I can do much much more, since I'm skipping the first array item (object?) to get the issue number, and then I take the first array item to define my title. arrayWorkerBee2VAR and comicTitleVAR are both string variables, I think.

 

I'm not necessarily posting this as a solution, but more showing how my head works around using the split in the hope that it'll help you find a way around it.

Thank you for the walk though. Very helpful!

Cheers, @PhilDevXX ! Thanks for asking a question that I actually was able to help with ... 😅

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (90,325)