I'm having trouble creating a flow to update a list item in Sharepoint with a 'Revision Number' of a file created/modified in a Sharepoint library.
Background
We have a folder with a set of drawings that are updated. New drawings will be transferred into this folder with a file name that is composed like this: "Sheet A.A104 Rev 3 - L1 Floor Plan".
I am updating a 'Register' of all drawings with sheet name, description and revision number - only the revision number changes.
I want to update the revision number property of the respective drawing item in the list when a new drawing is created.
I have tried to figure out the syntax of extracting the revision number from the file name with little luck. Is there anyone who might know how to get that info and update an item property with it?
Thanks,
Ethan
Solved! Go to Solution.
Hi @Anonymous,
Do you want to update the revision number property of the respective drawing item when a new drawing is created in your SharePoint library?
I have created a SharePoint list and a SharePoint library on my side, the data structure of it as below:
I have made a test on my side and please take a try with the following workaround:
@equals(item()?['Title'], split(split(triggerBody()?['{FilenameWithExtension}'], ' - ')[1], '.')[0])
item()?['ID']
Title field set to following formula:
item()?['Title']
The Revision field set to following formula:
substring(triggerBody()?['{FilenameWithExtension}'],add(indexOf(triggerBody()?['{FilenameWithExtension}'],'Rev'),4),sub(sub(indexOf(triggerBody()?['{FilenameWithExtension}'],'-'),add(indexOf(triggerBody()?['{FilenameWithExtension}'],'Rev'),4)),1))
Image reference:
The flow works successfully as below:
Best regards,
Kris
I am not quite clear on your process.
To be clear, you have a separate SharePoint list where you maintain a list of documents that are most current. When a new document is added to your library, you want to find the entry for the previous version in your list and update to the latest revision. Am I correct?
That's correct. Revision number has it's own column in the Sharepoint list.
Please see example images.
Document library where new drawings will be created:
Sharepoint list where drawing number & description don't change, only revision number needs to change from the file name added to the document library:
Hi @Anonymous,
Do you want to update the revision number property of the respective drawing item when a new drawing is created in your SharePoint library?
I have created a SharePoint list and a SharePoint library on my side, the data structure of it as below:
I have made a test on my side and please take a try with the following workaround:
@equals(item()?['Title'], split(split(triggerBody()?['{FilenameWithExtension}'], ' - ')[1], '.')[0])
item()?['ID']
Title field set to following formula:
item()?['Title']
The Revision field set to following formula:
substring(triggerBody()?['{FilenameWithExtension}'],add(indexOf(triggerBody()?['{FilenameWithExtension}'],'Rev'),4),sub(sub(indexOf(triggerBody()?['{FilenameWithExtension}'],'-'),add(indexOf(triggerBody()?['{FilenameWithExtension}'],'Rev'),4)),1))
Image reference:
The flow works successfully as below:
Best regards,
Kris
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.