Forum Discussion
Brandccc
Oct 04, 2022Copper Contributor
Auto-populating columns in SharePoint for existing files and folders
Does anyone know if there is a way to auto populate columns/metadata in SharePoint with default values for existing file and folders. I have tried by going into library settings and changed the defau...
Brandccc
Oct 04, 2022Copper Contributor
I only get the options of choosing the likes of latitude, longitude, city, country/region, timestamp, user name and user email which I have tried but again I get errors.
The ID has to be a integer of certain length
"The 'inputs.parameters' of workflow operation 'Update_file_properties' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'id' is required to be of type 'Integer/int64'. Converting the integer value '51.571610920882094' to type 'Integer/int64' will result in a loss of precision. Use the 'float()' expression if this is intended."
The ID has to be a integer of certain length
"The 'inputs.parameters' of workflow operation 'Update_file_properties' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'id' is required to be of type 'Integer/int64'. Converting the integer value '51.571610920882094' to type 'Integer/int64' will result in a loss of precision. Use the 'float()' expression if this is intended."
SvenSieverding
Oct 05, 2022Bronze Contributor
What kind of trigger did you use? Latitude/Longitude/City are properties of the "Manually trigger a flow" Trigger. You will need to use a SharePoint-Trigger
In order to make your usecase work with a flow you will need to
1) Create an automated Flow (Not a instant cloud flow)
2) Use the "When an item or file is modified"-Sharepoint Trigger and set that to watch your Document Library
3) Add some conditions that get the "folder path" from the trigger, decide in which folder the file is and i.e. in two variables with the properties for that folder
4) Check if the variables and the original data have the same value (you get the current values for the original data from the trigger)
5) If they are not the same, update the File using the "Update File Properties" Action. Use the ID you get from the trigger and the variables for the two values
Flows that sync informations between two sources can be a little bit complicated and error prone.
In my opinion you should alternatively take a look at "Document Sets"
https://mikehatheway.com/2022/02/17/modern-document-sets/
In order to make your usecase work with a flow you will need to
1) Create an automated Flow (Not a instant cloud flow)
2) Use the "When an item or file is modified"-Sharepoint Trigger and set that to watch your Document Library
3) Add some conditions that get the "folder path" from the trigger, decide in which folder the file is and i.e. in two variables with the properties for that folder
4) Check if the variables and the original data have the same value (you get the current values for the original data from the trigger)
5) If they are not the same, update the File using the "Update File Properties" Action. Use the ID you get from the trigger and the variables for the two values
Flows that sync informations between two sources can be a little bit complicated and error prone.
In my opinion you should alternatively take a look at "Document Sets"
https://mikehatheway.com/2022/02/17/modern-document-sets/
- BrandcccOct 06, 2022Copper ContributorThank for that, I tried doing/following your instructions but I am at a loss/can't quite figure it out.
- SvenSieverdingOct 05, 2022Bronze ContributorYou're welcome 🙂
In that case the trigger doesn't matter and you will need to use the Sharepoint "Get Files (properties only)" action after the trigger.
This will give you all files in the library (Change the TOP-Count in that action to the maximum possible size to try to get all of you files in one go)..
Then use an "Apply to each" action with the value of the previous action as an input parameter.
You will then have access to all file properties inside the "Apply to each" loop, including the id.
Add your update action there and use that id - BrandcccOct 05, 2022Copper ContributorThank you, would that work on all files or just that selected file, what I need to do is change the columns values for 2 columns for all existing files and folders in that library?
Thanks for your help again, it is much appreciated - SvenSieverdingOct 05, 2022Bronze ContributorAh... OK, sure..... In that case you should use the instant trigger "For a selected File". This Trigger will give you the ID to the selected file.
Then you can start the flow from the list. Mark the the file and then select "Automate" and then your flow from the list menus. Then your flow will be started on that File - BrandcccOct 05, 2022Copper Contributor
Thank you for helping with me with this.
I was using a manual trigger as it would run/triggered manually and only really used once or twice. I did not create the document library, it is a large existing library(s) which is owned by a completely different team.
Can I get the automated Flow to be manually triggered?