Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Get file content has an error when I want to splitting csv file: "Unable to process template language expressions in action"

Like (0) ShareShare
ReportReport
Posted on 6 Jul 2022 07:42:57 by 10

Hi!

 

I would like to create a flow which is waiting for a file created in a Sharepoint folder ("When a file is created in a folder" trigger).

jsz930801_0-1657092159292.png

 

I always copy .csv files into this folder which have to be processed. The trigger is followed by "Get file content" (File identifier is "x-ms-file-id") which is maybe the source of the problem, because the "Compose-split by new line" action recognizes type Object from the output of "Get file content" despite the csv file contains comma separeted values (there's no null value).

 

By the way I created this flow by this tutorial: https://www.c-sharpcorner.com/article/parse-csv-file-using-power-automate/

In this solution the path of the exact file is defined manually so it's not right for me because the flow should process the csv file automatically (when I copy it into the trigger's folder).

 

Could someone help me in this flow?

  • jsz930801 Profile Picture
    10 on 06 Jul 2022 at 12:45:17
    Re: Get file content has an error when I want to splitting csv file: "Unable to process template language expressions in action"

    Thank you so much!

  • Verified answer
    annajhaveri Profile Picture
    8,531 Most Valuable Professional on 06 Jul 2022 at 11:44:27
    Re: Get file content has an error when I want to splitting csv file: "Unable to process template language expressions in action"

    @jsz930801 you are using SharePoint Get File Content action which returns the data in Base64 encoding not the text data. So you need to following expression to convert it to a string, use following expression in the compose action which is failing for you:

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

     

    thanks to @Paulie78  , i got understanding from his video about parsing CSV file https://www.youtube.com/watch?v=sXdeg_6Lr3o

     

     

     

  • jsz930801 Profile Picture
    10 on 06 Jul 2022 at 08:18:22
    Re: Get file content has an error when I want to splitting csv file: "Unable to process template language expressions in action"
    This is the expression of "Compose-split by new line action":
    split(outputs('Get_file_content')?['body'],outputs('Compose-new_line'))
     
    The "Compose-new line" contains an empty line to denote a new one.
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on 06 Jul 2022 at 08:03:23
    Re: Get file content has an error when I want to splitting csv file: "Unable to process template language expressions in action"

    @jsz930801 can you please share the expression that you have used in the Compose-split by new line action?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 18 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 16

#3
Churchy Profile Picture

Churchy 12

Overall leaderboard
Loading started
Loading started