Update properties of a document in SharePoint with Flow

I had the requirement to update some properties of a document in a SharePoint Online document library based on another property. The source property is a string in the format 06.9.1.1. Three other fields needs to be updated when this property is modified.

Back in the old days you would do this with calculated columns. Those fields had some restrictions like that they can not be mapped to managed properties to be used in search solutions.

Trigger

The trigger for the Flow is when a file is created or modified.

Create variable

A variable of the type String is required for later in the process. The value of the field pmjCriterion is assigned to it.

Update file properties

pmjSE displays the first two characters of the variable ‘varCriterion’ en uses the prefix “SE”
–> concat(‘SE’,substring(variables(‘varCriterion’),0,2))

pmjPI displays the first four characters of the variable ‘varCriterion’
–> substring(variables(‘varCriterion’),0,4)

pmjPI displays the first six characters of the variable ‘varCriterion’
–> substring(variables(‘varCriterion’),0,6)

So when an item is updated the result is:


Conclusion

With the use of Flow in combination with Expressions it is pretty easy to update properties based on other properties of a document.