I've got a flow set up to send a bot message to Teams when a file is changed in a shared OneDrive directory. The message includes a link to the folder where the file resides. I want the text of this link to be the path of the directory, but in order for it to be user friendly, I want to only keep the part of the path which is after 'root:' and before the file name.
I want to do something like this:
substring( File Path, indexOf( File Path, 'root:' ) + 5, indexOf( File Path, File Name ) - indexOf( File Path, 'root:' ) + 5 )
To take this:
"/drives/b!KosGUJrQ10-JHf8xWUb2Zvba5vzW4a2Du7qcWPXQ99r1usopxzphRrN1IXAVuIeF/root:/External Shared/10466_SAFB/Exports/SAFB_PP.nwc"
to this:
"/External Shared/10466_SAFB/Exports/"
From what I can tell, Power Fx doesn't like the math operators in my expression. The expression returns no errors without the operators, but without the operators, I can't get the specific mid section of the string I want.
Any work arounds or suggestions?