Search file in a folder from Onedrive in Azure logic app

968 Views Asked by At

I'm having an issue using the OneDrive for Business - List files in folder action.

I'm setting the path of the action to be a parameter received from a previous step via http request.

The value of the path is for example - /Clients/ER/EDI/ERGL/Source

When I hard code the path by selecting it in the OneDrive action, its value at runtime is

"datasets/default/folders/01RODCPVEAQQCC4IDDRBF3JHJW2GR43CXZ" and at design time it is set to

"path":

/datasets/default/folders/@{encodeURIComponent(encodeURIComponent('01RODCPVEAQQCC4IDDRBF3JHJW2GR43CXZ'))}

However, when I try and set the path via parameter, which at design time looks like this

"path":

/datasets/default/folders/@{encodeURIComponent(encodeURIComponent(triggerBody()?['Source']))}"

and is at run time - /datasets/default/folders/%252FClients%252FER%252FEDI%252FERGL%252FSource

it does not work. I'm obviously missing something here, with encoding the path parameter? Any suggestions?

Thanks,

1

There are 1 best solutions below

1
George Chen On

Actually you get the true path, it's just in a encode format. You could find the example , the encodeUriComponent will return the URI-encoded string with escape characters.

So you could decode what you get with this expression:

decodeUriComponent(decodeUriComponent('%252FClients%252FER%252FEDI%252FERGL%252FSource'))

Then you will get the absolute path.

enter image description here

enter image description here

Hope this could help you, if you still have other questions, please let me know.