cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tpuehri
Advocate II
Advocate II

Sharepoint File Action should make FileID available!

How can i obtain the FileID for a newly created Sharepoint file in a flow which copies a file from onedrive for business.

i want to use the id in the next step to change document properties

there is only the FileSize available as dynamic content in the next action!!!

7 REPLIES 7
Tpuehri
Advocate II
Advocate II

I need the sharepoint file id in the next action after creating it by copying from onedrive.

 

I want to update the file properties after the file is copied from a onedrive folder.

 

Can anybody help?

Hi @Tpuehri,

 

If you mean to update the File property, then I don't think File identifier would be helpful here.

It would need to use the Item Id to update the corresponding item (file properties) fields.

And this is not a property provided by the create file Action.

We need first take use of the SharePoint ->Get Files(properties only ), then add a filter to find the proper item and then update the corresponding field:

See screenshots:

68.PNG

 

The formula used under the Condition is the following:

@equals(
           items('Apply_to_each')?['{Name}'], 
           first(
              split(body('Create_file')?['DisplayName'],'.')
                  )
             )

This is because the Name or the DisplayName content from the Create File content would contain the file extension, while the Name content from the Get Files(property only) don't contain the file extension, so to make the condition work, we need to split the DisplayName field.

Please check and see if this would work for you.

Running results from my side:

69.PNG

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

thank you!

I will test it.

 

Is there a documentation available on the commands you are using. Like @equals, split, body etc.

I am trying to figure out how to use them.

i did not get the meaning of body('Create File') yet. 

 

 

Yes,

See the documentation here:

WorkFlow Definition Language

 

Body('Create File' ) represents the Response Body of the SharePoint Create File Action,

And the Item('Apply_to_each') show the each item record data.

 

Post back if you need any further help on this.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,  

tested your suggested action but it runs into an error.

I think it is related to the input data for metadata columns.

 

05-08-_2017_16-36-39.png05-08-_2017_16-41-47.png

Additionally i am trying to delete the file from onedrive for business after copying it to sharepoint.

unfortunately the file is not deleted. i am using the fileid of onedrive05-08-_2017_19-10-30.png

i am not succeeding to update my metdata field which has a choice list (menu).

I am able to update text fields but no other field types.

 

Do i need a special function for updating?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,529)