cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PawelN
Regular Visitor

Onedrive connector - file creation date

Hi,

 

I have problem with obtaining creation date of files on my OneDrive with OneDrive connector in Flow. GetFileMetadata returns BlobMetadata object which contains a lot of file properties (e.g. LastModified), but whenCreated attribute (or similar) is missing there. Please let me know if it is possible to get file creation date using OneDrive connector (or in other way).

https://docs.microsoft.com/pl-pl/connectors/onedriveconnector/#blobmetadata 

 

Thanks 🙂

6 REPLIES 6
efialttes
Super User III
Super User III

Hi!

I assume that the files in your OneDrive folder are modified after you created them within your OneDrive folder, right? If not, you can relay on 'last modified time'.

I mean, according to this post from april 2018the creation date time could not be accesed via Power Automate, only last modified date time..

https://powerusers.microsoft.com/t5/Using-Flows/Delete-files-from-folder-after-180-days/td-p/110555

 

If your files can be modified, I can only think of having a flow that triggers when file is created, adds a tag with the creation date, but I must confess it sounds weird as a workaround.

Let's hope somebody else can point us to a more reasonable workaround.

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Pstork1
Dual Super User III
Dual Super User III

I was surprised to find that if you go look at the files in OneDrive for Business itself, the Created and Created By fields are not included in the properties for the file.  I think this is a deeper problem than the connector.  I think OneDrive doesn't actually maintain the Creation attributes because the assumption is that the owner of the OneDrive created the file.  The only way I can think of to get around this would be to use HTTP to do a REST call to get the first version of the file and use the modified attribute from that as the created data.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 

Can you elaborate a bit more the your suggestion to "use HTTP to do a REST call to get the first version of the file and use the modified attribute from that as the created data"? You mean deploying a custom connector to onedrive? AS far as I remember there is a "Send HTTP request to Sharepoint" but there is no "Send HTTP request to OneDrive" yet

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Hi, thanks for help! I re-checked my case again and probably LastModified will do the job. But I'm still really surprised that such basic attribute of file is not available...

@PawelN 

Yeah, it was surprising also for me... and this limitation seems to apply also to OneDrive For Business, which is also weird. I mean if you store files in Sharepoint, Created date time related info is available

Glad to see Last Modified can be a valid workaround for your scenario

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Pstork1
Dual Super User III
Dual Super User III

I haven't tried it, so I can't guarantee that it would work, but a couple of points to make.

 

1) OneDrive for Business is still a SharePoint site collection.  Yes it has been customized, but tends to have the same endpoints behind the scenes.  So I think using a REST call to get a list of versions will work.

2) There is a generic HTTP action in Power Automate also.  Behind the scenes it does the same thing the SharePoint HTTP action does.  The SharePoint one has been tailored for SharePoint and is standard instead of premium.  But you can make HTTP calls in Power Automate without building a custom connector.

 

Having said that.  I don't know that it will work, but it is one avenue of exploration.  Here's the documentation on the actual REST call to get versions. https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/listitemversion_get?view=odsp-graph... 

 

But the biggest question is whether OneDrive actually retains the creation info or not.  As I said, its built on SharePoint as a base, so I would assume its there.  But it might not be retrievable.  An interesting project to play with in my copious free-time while under lockdown.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (27,450)