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
Responsive Resident
Responsive Resident

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!

eliotcole
Responsive Resident
Responsive Resident

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

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,445)