cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radek1
Regular Visitor

Get file content from sharepoint

Hello,

 

I want to create a flow with a trigger when a file is created on sharepoint and use file content in next actions. So firstly I created "When a file is created in a folder" trigger, then I created a csv file and uploaded it:

 

Radek1_3-1632983957899.png

 

and everything went ok. I can see file content just fine.

 

Radek1_2-1632983851089.png

 

Now, I decided I need mail of person who created the file. I changed the trigger to "When a file is created (properties only)" and then used its dynamic functions to put "Identifier" in "Get file content". I expected the same result but the file content is different. 

 

 

Radek1_0-1632983583485.pngRadek1_1-1632983637681.png

 

What I need in the output is:

 

SIMF
ATSF
IMOF
BG1F

 

not

 

{
  "$content-type": "application/octet-stream",
  "$content": "U0lNRg0KQVRTRg0KSU1PRg0KQkcxRg0K"
}

 

How can I fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @Radek1 ,

 

This is because Get File Content will return the binary.

 

If you convert to base64 and then to string, you will see your original text

 

@base64ToString(base64(outputs('Get_file_content')?['body']))

 

ericcheng_0-1632988201928.png

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

 

View solution in original post

2 REPLIES 2
eric-cheng
Solution Sage
Solution Sage

Hi @Radek1 ,

 

This is because Get File Content will return the binary.

 

If you convert to base64 and then to string, you will see your original text

 

@base64ToString(base64(outputs('Get_file_content')?['body']))

 

ericcheng_0-1632988201928.png

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

 

Radek1
Regular Visitor

Thanks @eric-cheng, I would have never fixed it myself.

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Users online (3,224)