cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sega2
Helper II
Helper II

Get properties from a document set

I need to get properties from a document set and add it to a document every time a document is created within. Any suggestions? Best R, Thomas

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @sega2,

 

In that case you can probably first check if the parent folder is an item of type document set. You can check if the contenttypeid begins with 0x0120D520 (that is the id of the base Document Set content type).

 

If it is a document set you could retrieve its existing values and reuse it in update file properties action.

 

Below is an example of that approach.

This sample assumes that all document sets are created in the root of the library.

 

 

_api/web/lists/getbytitle('DocumentSetsExample')/Items?$filter=Title eq '@{split(triggerOutputs()?['body/{Path}'], '/')[1]}' and startswith(ContentTypeId, '0x0120D520')

 

 

documentset_updatefileproperties.png

View solution in original post

4 REPLIES 4
Expiscornovus
Dual Super User
Dual Super User

Hi @sega2,


In the past this was possible by simply enable the shared columns on the document content type settings. Have you tried that? Don't know if that feature still works with the modern document sets though.

 

sharedcolumns_setting.png

Thanks, that still work. However the problem is that if you choose shared they will inherit from the document set, and you cannot following change the values on the document to something else. We need to default get the value from the document set, and then if needed change the value to something else on the document it self.

Expiscornovus
Dual Super User
Dual Super User

Hi @sega2,

 

In that case you can probably first check if the parent folder is an item of type document set. You can check if the contenttypeid begins with 0x0120D520 (that is the id of the base Document Set content type).

 

If it is a document set you could retrieve its existing values and reuse it in update file properties action.

 

Below is an example of that approach.

This sample assumes that all document sets are created in the root of the library.

 

 

_api/web/lists/getbytitle('DocumentSetsExample')/Items?$filter=Title eq '@{split(triggerOutputs()?['body/{Path}'], '/')[1]}' and startswith(ContentTypeId, '0x0120D520')

 

 

documentset_updatefileproperties.png

Perfect! Thanks a lot highly appreciated.

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,817)