Would it be possible to get the 2nd folder name out of OneDrive4Biz ?
For example, how can I get a variable "1234" out of "/AssetList/1234/request.docx",
which is from OneDrive4Biz trigger "File path" ?
Upon someone creating the "request.docx" inside a specific folder of the OneDrive4Biz,
I want to create a SharePoint custom list item, whose title matches the folder name, "1234".
Playing a bit with "Date Operation - Compose" trigger, the "split" function
seems promising, but I couldn't find its full syntax ( or basic usage) to
set its return value to a variable.
Thanks in advance !
Solved! Go to Solution.
Hi @Tony_921,
Do you want to get the subfolder of AssetList folder of OneDrive for Business?
I have made a test on my side and please take a try with the following workaround:
split(triggerOutputs()['headers']['x-ms-file-path'],'/')
outputs('Compose')?[2]
Image reference:
The flow works successfully as below:
More details about expression in Microsoft Flow, please check the following article:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Best regards,
Kris
Hi @Tony_921,
Do you want to get the subfolder of AssetList folder of OneDrive for Business?
I have made a test on my side and please take a try with the following workaround:
split(triggerOutputs()['headers']['x-ms-file-path'],'/')
outputs('Compose')?[2]
Image reference:
The flow works successfully as below:
More details about expression in Microsoft Flow, please check the following article:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Best regards,
Kris
Thank you for the very informative reply as well as the screenshot, which really helped me. Without it, the procedure was too complicated to figure out by myself.
Your suggestions works great with sub-folder "1234".
However, I wanted this (single) flow to cover multiple folders, like
/AssetList/1234/request.docx
/AssetList/1235/request.docx
/AssetList/1236/request.docx
...
That's the reason why I wanted to extract the 2nd sub-folder name as a variable.
If "When a file is created" sets only with "/AssetList", it doesn't seem fire up with new files created under 1235 or 1236 sub-folders.
Is there any setting I might miss to set the "When a file is created" to monitor all sub-folders ?
Thanks for your further help !
Hi @Tony_921,
There is a known issue about File triggers, the file triggers won’t fire for files being added inside of nested folders inside the folder you select.
More details about Known issues and resolutions, please check the following article:
Best regards,
Kris
Then, I cannot help but just wait for the fix.
I marked this as answer question for now.
Thanks for your help !
Is their any update on this ? Could anyone help me on this
I used this from this example/solution split(triggerOutputs()['headers']['x-ms-file-path'],'/')
Main difference is from SharePoint not OneDrive, should that matter.
However, I get this error:
Unable to process template language expressions in action 'Compose' inputs at line '1' and column '9065': 'The template language expression 'split(triggerOutputs()['headers']['x-ms-file-path'],'/')' cannot be evaluated because property 'x-ms-file-path' doesn't exist, available properties are 'Transfer-Encoding, Retry-After, Vary, X-SharePointHealthScore, X-MS-SPConnector, X-SP-SERVERSTATE, DATASERVICEVERSION, SPClientServiceRequestDuration, SPRequestGuid, request-id, MS-CV, Strict-Transport-Security, X-FRAME-OPTIONS, Content-Security-Policy, MicrosoftSharePointTeamServices, X-Content-Type-Options, X-MS-InvokeApp, Timing-Allow-Origin, x-ms-apihub-cached-response, Cache-Control, Date, Location, P3P, X-AspNet-Version, X-Powered-By, Content-Type, Expires, Last-Modified, Content-Length'.
Can someone please advise?
Hi, I used your way to get the folder name, but I am not getting the correct output. will appreciate your help on this.
Did you ever get this working? i am getting the exact same issue with SharePoint
No I did not.
User | Count |
---|---|
27 | |
16 | |
14 | |
10 | |
10 |
User | Count |
---|---|
45 | |
29 | |
28 | |
24 | |
23 |