cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

update file properties only shows "File size" from previous file actions

As the subject says - update file properties only shows "File size" from previous file actions when trying to select the ID.

tried getting file metadata from path, getting file properties - all just resturn the File Size property when I click into the ID field....I need the ID...?

Here I'm focused on the ID input field;

flow.jpg

 

If I click into another field, (other than ID, like Title), then all the dynamic properties pop up!

flow2.jpg

 

So am I using this incorrectly?

 

Kind regards,

 

R

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: update file properties only shows "File size" from previous file actions

OR you can do this, which I just figured out on a hunch, because a document library is basically a list;

 

  • Save the file
  • Add an action to update a SharePoint LIST item
  • Add a custom value for the list and type in the name of the document library
  • There you have all the properties you need to update the custom columns

flowfileproperties.png

 

Tested, works, done.

 

Kind regards,

 

R

View solution in original post

9 REPLIES 9
Community Support Team
Community Support Team

Re: update file properties only shows "File size" from previous file actions

Hi @Anonymous,

 

Which property that you would like to update with, the file itself, or the added column fields in the Library item?

 

For the file itself, please switch to update file Action,

77.jpg

 

If you would like to update the file properties added as additional column in the Library item, we need to do it in the following way:

  1. Add “When a new email arrives” as a trigger, configure Include Attachments property to Yes
  2. Add “Apply to each”, configure Output to attachments content of “When a new email arrives” trigger. In “Apply to each” box, add “Create file” action. This step will create files in specific folder based on each attachment.
  3. In order to get the properties saved in the columns in the library for all folders and files stored in the library, add “Get files(properties only)” action.
  4. Add “Select action”, configure From to Value content of “Get files(properties)” action. Under map entry, enter two keys and values as below: The Name value and ID value are selected in Dynamic content of “Get files(properties only)” action
  5. Add Variable-> Initialize Variable action, Name set to IDAndDisplayNameArray, type set to Array, Value set to the Select Output
  6. Add “Do Until”, condition set to: @empty(variables('IDAndDisplayNameArray'))
  7. Within “Do Until”, add a Filter array, From set to attachments content of “When a email arrives” trigger, condition set to the following: @equals(item()?['Name'],first(variables('IDAndDisplayNameArray'))['DisplayName'])
  8. Add “Update file properties” action, specific your Site Address and Library Name, Id set to following:  first(variables('IDAndDisplayNameArray'))['ItemID']
  9. Add Compose action, Inputs set to: skip(variables('IDAndDisplayNameArray'),1)
  10. Add Variables-> Set Variable action, Value set to output of Compose

Image reference:

1.jpg

3.jpg

4.jpg

5.jpg

6.jpg

9.jpg

11.jpg

12.jpg

 

More details about the usage of “Update file properties” action and “Update file” action, read the article as below:

Usage of “Update file properties” action

Usage of “Update file” action

 

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.
Dual Super User
Dual Super User

Re: update file properties only shows "File size" from previous file actions

Just guessing... maybe the Id received as opuput of "Create File" is a string; but ID expected as input by "Update File properties" needs to be an Integer.

If so, int conversion function defined in WDL can help you

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

Hope it helps





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





katonage
Level 8

Re: update file properties only shows "File size" from previous file actions

I understand this mechanism but it is a shame how complicated this is. Flow is created for the non developers to create magic quickly, now we force them to make a simple 'four line' for loop in a *very* complicared way: three pages of printscreen required to document it.

- does not even documents it properly as this dynamic label items dont show from which action they were selected: for example ID item gives different output from different action of the sharepoint connector - obscured.

* why these actions dont take both integer and path and also identifier string as input?

* little labels should show detailed syntaxat least on mouse hoover-on

g.

Dual Super User
Dual Super User

Re: update file properties only shows "File size" from previous file actions

@katonage

I agree it is a bit frustratring to realize something that should be implemented in two-three simple steps needs workarounds.

Let's hope Flow team will continue working hard to improve this tool as they have been doing in the last months. I am working mainly with Sharepoint based Flows, and the improvement on this area has been really huge, although there is still a lot of work to be done. 

 





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





katonage
Level 8

Re: update file properties only shows "File size" from previous file actions

That was my solution at the end. After creation / copy you research the whole library with

FileLeafRef eq 'Name​​'

(found somewhere here in the community) in the Get files Filter query

then you need to hijack the ID from the one element list using a variable

 

Untitled.png

 

Dual Super User
Dual Super User

Re: update file properties only shows "File size" from previous file actions

@katonage

Thanks for sharing!





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





Anonymous
Not applicable

Re: update file properties only shows "File size" from previous file actions

OR you can do this, which I just figured out on a hunch, because a document library is basically a list;

 

  • Save the file
  • Add an action to update a SharePoint LIST item
  • Add a custom value for the list and type in the name of the document library
  • There you have all the properties you need to update the custom columns

flowfileproperties.png

 

Tested, works, done.

 

Kind regards,

 

R

View solution in original post

mrjoewilson
Level: Powered On

Re: update file properties only shows "File size" from previous file actions

It is odd to me that you are able to use the ItemID dynamic content in Update Item; however, I tested it and could not.

Anonymous
Not applicable

Re: update file properties only shows "File size" from previous file actions

It might be specific to my method, not sure if relevant but....;

 

  1. I'm using the flow template "Upload file to SharePoint from PowerApps" as my base - this is required as the powerapps inputs don't work otherwise.  Even if you create this flow and then "Save As" to create a copy - the copy won't work.
  2. I'm converting the image from base64 to jpg using an azure function and returning the content back to the flow
  3. I create the file in SharePoint and then update the item using the method above.

 

Still working for me - I've also discovered that this trick works inside PowerApps as well, meaning I can directly update file properties using an edit form that has the library as a data source.

 

flowfileproperties2.png

 

With this, I can just update custom columns on a library direct from PowerApps without updating the actual file, which is a massive win for some of our "doc management and approval flow" apps.

 

Kind regards,

 

R

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,530)