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 / Unable to process temp...
Power Automate
Answered

Unable to process template language expressions: 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Object'.

(0) ShareShare
ReportReport
Posted on by 26
Error Details
Unable to process template language expressions in action 'Split_lines' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Object'. 

 

This is the function:

 

split(outputs('Get_file_content_using_path')?['body'],decodeUriComponent('%0D%0A'))

 

The file is a CSV file with format of Win(CRLF)

 

The flow:

OSzuliko_0-1673262539882.png

 

Can someone help?

Categories:
I have the same question (1)
  • OSzuliko Profile Picture
    26 on at

    I changed the function to the below:

     

    split(base64ToString(outputs('Get_file_content_using_path')?['body']['$content']),decodeUriComponent('%0D%0A'))

     

    There is no more error, but it never progresses past this stage. It completes in 0 seconds, but there is no output. I have also attached the export of the flow

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Assuming your CSV data doesn't contain any commas within the actual values, this is how I would build my flow.

     

    In this example, I'm using the following CSV file.

    grantjenkins_1-1673326363010.png

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_2-1673326441102.png

     

    Get file content using path retrieves the CSV file data.

    grantjenkins_3-1673326476722.png

     

    Compose uses the following expression to extract out the actual data. You already have this expression - except I've wrapped a skip to remove the headers.

     

    skip(split(base64ToString(outputs('Get_file_content_using_path')?['body']['$content']),decodeUriComponent('%0D%0A')), 1)

     

    grantjenkins_4-1673326557757.png

     

    Filter array takes the output from Compose and uses the following expression to remove any empty rows (the last row will always be empty).

     

    trim(item())

     

    grantjenkins_5-1673326635266.png

     

    Select takes the output from Filter array and uses the following expressions to extract each of the values. Note that I'm using Text mode (see arrow on screenshot).

     

    //Name
    split(item(), ',')[0]
    
    //Color
    split(item(), ',')[1]
    
    //Status
    split(item(), ',')[2]

     

    grantjenkins_6-1673326749746.png

     

    The output from the Select after running the flow is:

     

    [
     {
     "Name": "Grant",
     "Color": "Blue",
     "Status": "Approved"
     },
     {
     "Name": "Harry",
     "Color": "Red",
     "Status": "Pending"
     },
     {
     "Name": "Helen",
     "Color": "Pink",
     "Status": "On Hold"
     }
    ]

     

     

    grantjenkins_9-1673326895933.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • v-xiaochen-msft Profile Picture
    on at

    Hi @OSzuliko ,

     

    I've made a test but did not encountered the problem you mentioned

    vxiaochenmsft_0-1673331625732.png

     

     

    vxiaochenmsft_1-1673331625735.png

     

     

    Please check the value of base64ToString(outputs('Get_file_content_using_path')?['body']['$content']),

     

    You could add a compose action an set it's value to base64ToString(outputs('Get_file_content_using_path')?['body']['$content']) and then check it's value in run history.

     

    Best Regards,

    Wearsky

  • OSzuliko Profile Picture
    26 on at

    Thanks Grant! This works. I have arrived at something similar together with a Power Automate expert. 😊 Here is a thumbs up and thanks for providing the solution!

  • xspyboyx Profile Picture
    6 on at

    Thank you so much! This was a huge help. I spent hours trying to figure this out. I have an odd issue I'm hoping someone can help me with.

    My CSV columns have some ',' in the data values so when I do a split, it's splitting the value and ruining the other entries in the table. for example, my CSV data is like 'Business,Reseller,PC Led","\"DUCK, LLC\",Product number' and it's splitting at the comma at "DUCK, LLC". The CSV put "\" around the values with ',' in them. Is there a way to fix this so the commas in my values either stay intact or get removed? I was thinking maybe running a regex to replace ',' inbetween the "\" value "\" may work, but after several hours I clearly have no clue what I'm doing! I just need some way to split my data at the ',' without the values with ',' runing the entire thing. If someone can help me figure that out your solution works great for me! Thanks!

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard