cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
westerdaled
Level: Powered On

Running an approval Flow but only on a certain Content Type Id

Hi

 

I want to trigger a flow in a document library but only for a certain content type. Now I could cheat and use powershell to get the desired content type id but I wondered if there was a dynamic expression I could use

 

I guess my condition would look something like this

@equals(triggerBody()?['ContentTypeId',], '?'')

Has anyone tried this ?

1 ACCEPTED SOLUTION

Accepted Solutions
westerdaled
Level: Powered On

Re: Running an approval Flow but only on a certain Content Type Id


@v-yamao-msft wrote:

Hi @westerdaled,

 

Do you have a custom column in the library called Content Type Id?

 

If yes, the Condition could be configured likes:

@equals(triggerBody()?['ContentTypeId',], '?')

 

Please take a try with it on your side.

 

 

Best regards,

Mabel Mao


Hi @v-yamao-msftsorry for the confusion.  It turns out that I can use the Content Type Name property as shown below.  I wanted to put a couple of cotnent type in the library but only run the workflow on one type

 

@equals(triggerBody()?['{ContentType}']?['Name'], 'IT Policy')

 

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Running an approval Flow but only on a certain Content Type Id

Hi @westerdaled,

 

Do you have a custom column in the library called Content Type Id?

 

If yes, the Condition could be configured likes:

@equals(triggerBody()?['ContentTypeId',], '?')

 

Please take a try with it on your side.

 

 

Best regards,

Mabel Mao

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

Re: Running an approval Flow but only on a certain Content Type Id

@westerdaled:

 

Let me suggest a simple solution.

 

You might try adding a new site column to the content type.  Set a default value for the site column.  Then, your condition can check for the default site column value.  This column will only have a value if the entry uses the content type to which you added the site column.  You'll probably want to make this a hidden column.

 

Please note that this would not be neccessary if Flow were "content type aware". I added a "Flow idea" for this here - please vote for it if you think it's a good idea.

 

If this solves your issue, please mark your post as solved.

 

Scott

 

 

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

Scott
westerdaled
Level: Powered On

Re: Running an approval Flow but only on a certain Content Type Id


@v-yamao-msft wrote:

Hi @westerdaled,

 

Do you have a custom column in the library called Content Type Id?

 

If yes, the Condition could be configured likes:

@equals(triggerBody()?['ContentTypeId',], '?')

 

Please take a try with it on your side.

 

 

Best regards,

Mabel Mao


Hi @v-yamao-msftsorry for the confusion.  It turns out that I can use the Content Type Name property as shown below.  I wanted to put a couple of cotnent type in the library but only run the workflow on one type

 

@equals(triggerBody()?['{ContentType}']?['Name'], 'IT Policy')

 

View solution in original post

westerdaled
Level: Powered On

Re: Running an approval Flow but only on a certain Content Type Id

@ScottShearer I like your thinkiing but it looks like the Flow is content type aware - I got it to alert me with the content type name.

I only used Oontent Type Id as this was the first dynamic field I saw in the list.  Turns out I don't need it. 

Super User
Super User

Re: Running an approval Flow but only on a certain Content Type Id

@westerdaled:  

 

You are correct - content type ID is now available to you.  I believe that this became available within the past few days in my tennant.  When I tested before posting my response, I did not see content type ID or content type name as available in Dynamic properties.

 

I suspect there may be some more good news to come regarding the use of SharePoint content types and Flow.

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

Scott

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
Users Online
Currently online: 431 members 5,989 guests
Please welcome our newest community members: