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 / Error when using split
Power Automate
Unanswered

Error when using split

(0) ShareShare
ReportReport
Posted on by 48

Hi,

 

I have a flow, where someone is filling out a form that is then approved. Once it is approved I need to use the information from this form to enter information into a different form. I have one field where I need to split the information in order to use it in the new form that I am entering information into.

 

I got help previously for how to make this split and it works. Now I have had to do some changes to the flow (removing an adaptive card for approval and therefore moving this part of the flow to a new flow), but now it keeps failing. When I test it out it keeps giving me this error:

 

Unable to process template language expressions in action 'Split_first_2' inputs at line '1' and column '23835': 'The template language function 'split' expects two parameters: the string to split as the first parameter, the separator as the second parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#split for usage details.'.

 

Does anybody know why it does that and what I can do?

 

Thank you!

 

Best,

Majken

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @YDRDK,

     

    It looks like it is missing either the string or the separator, because the error says you only have 1.

     

    Can you share a screenshot of your current flow setup and the split expression you are using?

  • YDRDK Profile Picture
    48 on at

    Hi @Expiscornovus 

     

    Yes for course.

     

    Picture 1.PNGPicture 2.PNG

    The expression I am using is this: 

    trim(first(split(triggerOutputs()?['body/Project_x0020_ID_x0020_Name']))) - and last in the other one. The "triggerOutputs()?['body/Project_x0020_ID_x0020_Name']" is chosen from dynamic content.
     
    Before I had a adaptive card in where the user should approve some things before this split was used and it worked great in that flow, however the turns out that the adaptive card is not useful in this situation anyways. 
     
    I hope this can help you.

     

  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @YDRDK,

     

    Your expression is missing a separator in the split function. Normally this would be something like a comma, semi-colon or whatever character you want to use.

    splitfunction_example.png

     

    In your case the expression would be something like this. Replace the comma by something you want to use.

    trim(first(split(triggerOutputs()?['body/Project_x0020_ID_x0020_Name'], ',')))

     

     

  • YDRDK Profile Picture
    48 on at

    Thank you @Expiscornovus - that worked! 🙂 I must have missed that part of it and I was going crazy because I could not figure out how.

  • MTEChris Profile Picture
    7 on at

    I have a similar case, where I need to do a split on a user defined input. The problem is that the user sometimes doesn't  use the delimiter. I've tried the following code but keep getting an error.  Essentially I want to split it if the delimiter is used, but no split if it is not.

    if(length(split(triggerOutputs()?['body/subject']))>1,split(triggerOutputs()?['body/subject'],'_')[0],triggerOutputs()?['body/subject'])

    Any ideas how to clear it? Thanks!

  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @MTEChris,

    try this:

    if(contains(triggerOutputs()?['body/subject'],'_'),split(triggerOutputs()?['body/subject'],'_')[0],triggerOutputs()?['body/subject']) 

  • MTEChris Profile Picture
    7 on at

    That worked! Thanks @VictorIvanidze for the help!

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard