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
Community Support
Community Support

Re: Get File Content from OndDrive with dynamic file name

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.
ktvision Helper I
Helper I

Re: Get File Content from OndDrive with dynamic file name

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.'.

 

Community Support
Community Support

Re: Get File Content from OndDrive with dynamic file name

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.
a8nb5zz
Frequent Visitor

Re: Get File Content from OndDrive with dynamic file name

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
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,312)