cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ktvision
Helper I
Helper I

Get File Content from OndDrive with dynamic file name

I'm tring to get a file content from my One Drive.  The file name is dynamic.  Therefore, I can't just select the name from the system.

The file is in the "MCCMINvoice" folder in my One Drive.  Therefore, I try to use the "Concat" function as in a file path (location and name) as below.  the "varInvNo" is the name of file, but it is erroring out.

 

Any help will be greatly appreciated.  Thanks

 

concat('/MCCMInvoice/', variables('varInvNo'), '.jpg')
FlowError.png
 
4 REPLIES 4
v-bacao-msft
Community Support
Community Support

Hi @ktvision,

 

Using Get file content action, you couldn't get the file content in this way.

Since you want to use the path of the file to get the contents of the file, you could use Get file content using path action.

I did a test on my side, using a variable to save the file name and using the concat() function to make up the file path.

concat('/Test/',variables('fileName'),'.PNG')

19.PNG

It work, as below:

20.PNG

Take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FIrst,  thank you so much for your replay.

I tried, but I'm getting the error message below.

This is my express on "Get file content using path", concat('/MCCMInvoice/',variables('varInvNo'),'.jpg')
Please help...
 
InvalidTemplate. Unable to process template language expressions in action 'GetSigByPath' inputs at line '1' and column '1894': 'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_onedriveforbusiness_1']['connectionId']' cannot be evaluated because property 'shared_onedriveforbusiness_1' doesn't exist, available properties are 'shared_onedriveforbusiness'. Please see https://aka.ms/logicexpressions for usage details.'.

 

Hi @ktvision,

 

Have you tried recreating a Flow and creating a new connection to OneDrive?

You could try to remove exist OneDrive connection, then create a new Flow, configure new actions and connection.

Take a try and let me know if issue still exist.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi can you help me I have the same flow.i want to get the file from onedrive.filename is customer code.and it will be attached in sharepoint as per customer code

pic 1.PNGpic 2.PNG

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (76,241)