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 / Help with using Split ...
Power Automate
Answered

Help with using Split and Skip to define values in Select action

(0) ShareShare
ReportReport
Posted on by 21

Hello All, 

 

I'm creating an automatic flow (email trigger) that collectes data from a table within the body of an email by converting HTML to a JSON array. 

 

My flow is 90% complete but I'm really struggling with an expression for the select action. 

 

The body is the outputs of a Compose action that 'Splits' table rows into an array.

 

 

body = ["Jerry’s^Apple^Banana^Orange^Pear^grape^Kiwi^ Lemon",Mummers_1-1692034300376.png

Etc…

]

Shop = split(item(), '^')[0]

Fruit = skip(split(item(),'^'),1)

 

 Gives me the below ouput. Is there a way to isolate a single fruit in this case Grape? (Highlighted)

 

I've tried various combintions of Split/Skip on Item() but I haven't had any success. Any advice would be appreciated. 

 

Mummers_2-1692034815946.png

 

 

 

 

Categories:
I have the same question (0)
  • rzaneti Profile Picture
    4,262 Super User 2025 Season 2 on at

    Hi @Mummers ,

     

    Use this expression:  body('Select')[0]['Fruit'][4]

     
    Here is my test:
    rzaneti_0-1692035649345.png

     

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 

     
  • Mummers Profile Picture
    21 on at

    Hi @rzaneti

     

    Thank you for the assits! Your method is a good way to isolate 'grapes' from my array but would it be possible to get the same result using the 'Select' function?

    I would like the ouputs from 'Select' to be:

    Mummers_0-1692041714894.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    So I can use the 'Parse JSON' step with the following Schema:

    Mummers_1-1692042012372.png

    and ultimatley get my desired results using expressions such as: 

     
    outputs('Parse_JSON')['Body'][0]['shop']
    outputs('Parse_JSON')['Body'][0]['Fruit']
     
    outputs('Parse_JSON')['Body'][1]['shop']
    outputs('Parse_JSON')['Body'][1]['Fruit']
     
    etc...

     

    Cheers, Mummers. 

     

  • rzaneti Profile Picture
    4,262 Super User 2025 Season 2 on at

    Hi @Mummers ,

     

    I'm not sure if this is exactly what you need, but using this expression: skip(split(item(),'^'),1)[4], you will achieve this result:

    rzaneti_0-1692051059330.png

     

    To access the grapes, we will need it to be always at the same position in the array (5th fruit). If this is not exactly what you need, let me know and we can investigate further 🙂

     

     

  • Mummers Profile Picture
    21 on at

    Hi @rzaneti,

     

    Thank you again for the response 👍

     

    Unfortunatley, I keep getting an invalid template error: 

     

    The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{
    "Shop": "@split(item(), '^')[0]",
    "Fruit": "@skip(split(item(),'^'),1)[4]"
    }' failed: 'The template language expression 'skip(split(item(),'^'),1)[4]' cannot be evaluated because array index '4' is outside bounds (0, 0) of array. Please see https://aka.ms/logicexpressions for usage details.'.

     

    I tried to brute force a fix by playing around with the 1 & 4 values, but havent had any luck. 

     

    I'm tempted to abandon my JSON attempt and use HTML parsing to achieve my goal, but i do feel like I'm getting close. 

     

    Thanks again!

     

     

  • rzaneti Profile Picture
    4,262 Super User 2025 Season 2 on at

    Hi @Mummers ,

     

    I also believe that you are close to the solution! If you want to move forward with that approach now or in the future, please share an image from the compose output where you have the fruits separated by '^', just to I make sure that I will include the exact same template in my tests to identify the expression's error.

  • Verified answer
    Mummers Profile Picture
    21 on at

    Hi @rzaneti 

     

    I did have some success last night. using: skip(split(item(),'^'),5) as the value for Fruit in the 'Select' action I was able to get the following output: 

     

    Mummers_0-1692103958603.png

    I then used: 'Compose' outputs('Parse_JSON')['Body'][0]['Fruit'] 

     

    followed by 'Compose' join(outputs('Compose_5'),',') to get Grape,Kiwi,Lemon

     

    then a final 'Compose' split(outputs('Compose_7'), ',')[0] to get: Grape

     

    It's an inelegant solution - but it works 😃

     

    I've added the outputs from Filter Array 2 below if you can think of 'less-clunky' solution. 

     

    Thank you again for all your imput - It's really apprecaited!

     

    Mummers_1-1692104819709.png

     

     

    ]

    "Jerry’s^Apple^Banana^Orange^Pear^grape^Kiwi^ Lemon",

    "Sam’s^Apple^Banana^Orange^Pear^grape^Kiwi^ Lemon",

    "Smith’s^Apple^Banana^Orange^Pear^grape^Kiwi^ Lemon",

    "Brian’s^Apple^Banana^Orange^Pear^grape^Kiwi^ Lemon",

    "John’s^Apple^Banana^Orange^Pear^grape^Kiwi^ Lemon",

    ]

     

     

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