Hello All,
I am building a approval flow; once a file created in a specific sharepoint folder it triggers an approval flow. Briefly;
Trigger: A pdf file is saved to sharepoint folder (we have particular name format for the files uploaded, like vendorname_month_16digitdocnumber for example ABCCORP_02_GIS2020000012345)
1- an automated request goes to x person for registration of this document,
a) at this point flow creates a new row and gets the last 16 characters of the file name (GIS2020000012345) and inputs it in the column named "Document Number" in an excel sheet which is saved to a sharepoint folder.
b) next flow updates the row created in previous step>>a, and puts the date to the column named "Receiving Date" with the format "mm/dd/yyy"
Could you help me with this?
Thanks in advance!
Regards,
EmTu
Solved! Go to Solution.
I have solved it with
1-Initialize variable >>> triggerOutputs()?['body/{FilenameWithExtension}'] to Value field
2-Compose >>> last(split(replace(variables('DocumentNumber'),'.pdf',''),'_')) to Inputs field.
Hi @Emtu
Use the expression below
last(split('filename','_'))
This will give GIS2020000012345
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blog@abm thank you for your quick answer but it gives filename as an output.
I have tried last(split(triggerOutputs()?['body/{Identifier}'],'_')) but this time it gave an output with file extension like GIS2020000012345.pdf
Hi,
You could another split as with '.' (dot) as delimiter as use first expression to get the result.
first(split('filename",'.'))
Or if you have fixed length for the full string then you could use substring() expression without using two splits.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogI have solved it with
1-Initialize variable >>> triggerOutputs()?['body/{FilenameWithExtension}'] to Value field
2-Compose >>> last(split(replace(variables('DocumentNumber'),'.pdf',''),'_')) to Inputs field.