Forum Discussion
Sharepoint Library Created and Modified Dates
claire2020 Writing column name directly like this will not work. Try configuring your flow as given below:
Use body like:
{
"formValues": [
{
"FieldName": "Created",
"FieldValue": "@{formatDateTime(item()['WFCreated'], 'dd/MM/yyyy HH:MM')}"
}
],
"bNewDocumentUpdate": true
}
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
ganeshsanap Thank you so much, I'm very new to working with flow and http requests, and that worked almost perfectly - it updates the 'created' date, but it's a day behind - here is the screenshot, so where WFCreated is 17th, it puts the created date as 16th? I'm guessing it's time zone related, but I'm not sure how to put this in the http body - thank you for your help
- Paul_HK_de_JongOct 15, 2022Iron Contributor
claire2020
The Power Automate approach is one that works for you. Good to hear.Another approach is to extract the create and modify dates from the files itself (not the OS). Most common file formats such as docx, xlsx, pptx, doc, xls, ppt, pdf, jpg, png, msg, eml, ... contain the create and modify date within the files.
For example,
Example of metadata in PDF file
If these values are extracted during uploading into a SharePoint column then this offers a better approach for applying retention labels based on the actual create/modify dates and not the OS dates.Note: there are file formats such as zip, txt that do not have the capability.
- ganeshsanapOct 14, 2022MVP
claire2020 You're welcome, very glad it worked for you!
Please consider giving a Like if my post helped you in any way.
- claire2020Oct 14, 2022Copper Contributor
ganeshsanap thank you, I have used that and it works, so thank you for all your help, very much appreciated
- ganeshsanapOct 14, 2022MVP
claire2020 Try using convertToUtc or convertTimeZone function instead of "formatDateTime" function in body.
Please consider giving a Like if my post helped you in any way.
- SvenSieverdingOct 14, 2022Bronze ContributorWhere exactly in the world are you?
Your date is most likely not in the correct zimezone format. so try this formula
@{convertTimeZone(item()['WFCreated'],'<Your Time Zone>','UTC','dd/MM/yyyy HH:MM')}
<Your time zone> is your local time zone....
I use "W. Europe Standard Time" as a value for my timezone, you can get yours from https://www.ge.com/digital/documentation/meridium/V36160/Help/Master/Subsystems/AssetPortal/Content/Time_Zone_Mappings.htm
(from the column "Standard Time Zone Name")
If that does not work, then also try switching the timezone parameters:
@{convertTimeZone(item()['WFCreated'],'UTC','<Your Time Zone>','dd/MM/yyyy HH:MM')}