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

Notifications

Announcements

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
    68,717 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,363 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,363 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard