I have created a flow that updates a table in excel anytime a document is uploaded to sharepoint.
I use the split function to separate the file path like the example here:
https://powerusers.microsoft.com/t5/Building-Flows/Using-Split-Function-for-Folder-Path/td-p/366527
I am having one issue with it though. In my case, the file path may be different from time to time. Using the above example let's say the file path is:
Job Site Name/District/Vendor Name/Service Reports/PO 12345 Service Report.pdf
Or it may be:
Job Site Name/District/Vendor Name/Service Reports/Location/PO 12345 Service Report.pdf
And I want to recall the "Vendor name" and the "District" to update my excel table.
Using these formulas
last(take(outputs('Compose'),sub(length(outputs('Compose')),2)))last(take(outputs('Compose'),sub(length(outputs('Compose')),3)))I can recall the "Vendor name" and "District", but since it starts from the end of the file path and moves backwards, in the second file path it would return the "Service Reports" and "Vendor Name".
My question is this. Since the information I need is always in the same location starting at the left of the file path instead of the right, is there anyway to do that instead of starting at the end and moving backwards?
Thank you for your help!