web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using split() or subst...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 11

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

 

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,125 Most Valuable Professional on at

    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.

  • eliotcole Profile Picture
    4,390 Moderator on at

    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.

  • PhilDevXX Profile Picture
    11 on at

    Thank you for the walk though. Very helpful!

  • eliotcole Profile Picture
    4,390 Moderator on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard