cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GFinlayTerumo
Helper II
Helper II

When a File is created in a folder - Excel Get Worksheets

I have a .csv file that is to be uploaded to a SharePoint site, the Flow will then go through the data and update information based on the content of the file.

 

I have tried to use the File Name Encoded and get Item Not Found error

GFinlayTerumo_0-1618400212570.png

GFinlayTerumo_1-1618400341179.png

 

I have also tried using the Get HTTP Request From SharePoint action but I cannot figure out how to get the correct Uri.  

GFinlayTerumo_5-1618400890877.png

I get the following error;

 

GFinlayTerumo_4-1618400849432.png

My Document Library does not sit in the default Documents library.
GFinlayTerumo_3-1618400740456.png

 

What am I doing wrong with the HTTP GET request?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hello @GFinlayTerumo 

 

In HTTP you can can get the file content - using the below.

 

CFernandes_0-1618402358266.png

 

API URI - _api/web/GetFolderByServerRelativeUrl('Source')/Files('@{outputs('Get_file_properties')?['body/{FilenameWithExtension}']}')/$value

 

Reference  - https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

Hey @GFinlayTerumo 

 

From the Body you can extract the base64 using the formula below-

 

outputs('Send_an_HTTP_request_to_SharePoint')?['body']['$content']
 
You can then Convert the above to String -
 
base64ToString(outputs('Compose'))
 
CFernandes_0-1618404793606.png

 

 

Output -

 

CFernandes_1-1618404827090.png

Now that you have the content you might be able to use it for your requirement.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

10 REPLIES 10
CFernandes
Super User
Super User

Hey Mate,

 

@GFinlayTerumo 

 

A Quick question, If you click on the Folder, can you select the file?

 

CFernandes_0-1618401894135.png

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi thanks for your reply.  I can just now but that's only because the file is was uploaded then the flow failed.

 

The whole point of the flow is to trigger when a file is uploaded so it won't be selectable in the Get worksheets as it will have just been created.


Thanks

Hello @GFinlayTerumo 

 

In HTTP you can can get the file content - using the below.

 

CFernandes_0-1618402358266.png

 

API URI - _api/web/GetFolderByServerRelativeUrl('Source')/Files('@{outputs('Get_file_properties')?['body/{FilenameWithExtension}']}')/$value

 

Reference  - https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

Hi

 

Thanks for the info, this is passing and I can now see 'body' in Dynamic Content.  However I cannot seem to use it for anything, my initial plan was to use the csv that was uploaded and iterate through the rows by creating a table.  I would then use the information in the table to update a series of lists based on each line.

 

How can I use the File content that this HTTP request has gotten?

 

Thanks

Hey @GFinlayTerumo 

 

From the Body you can extract the base64 using the formula below-

 

outputs('Send_an_HTTP_request_to_SharePoint')?['body']['$content']
 
You can then Convert the above to String -
 
base64ToString(outputs('Compose'))
 
CFernandes_0-1618404793606.png

 

 

Output -

 

CFernandes_1-1618404827090.png

Now that you have the content you might be able to use it for your requirement.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Hi this is definitely a step in the right direction I should be able to use this to iterate through.

Thanks

Hey @GFinlayTerumo ,

 

I am glad that my inputs helped. I hope that you have learned something new 😀.

Hi @CFernandes 

 

thanks again for your help.  I now have the csv data in the following Compose

GFinlayTerumo_0-1618411483110.png

I am now attempting to either build a table with the information in the Full Name column or just have an array with the information so as I can use each name to iterate through my list.

I've tried using split() but I can't find a good way to make it work.  I have also tried just Appending to an Array variable but it just takes everything as one value.

 

Do you have any ideas?

Thanks

@GFinlayTerumo 

 

Hey Mate, 

 

What happens when you split using space?

 

split(<variable>,')
 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi

 

It doesn't give me the expected results.  I have decided to go another way with my project but thanks for all of your help.  The HTTP request part will definitely come in handy somewhere else.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,854)