cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Helper I
Helper I

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

6 REPLIES 6
Highlighted
Community Support
Community Support

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.
Highlighted
Super User III
Super User III

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
Highlighted
Helper I
Helper I

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

Highlighted
Helper I
Helper I

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. 

Highlighted
Super User III
Super User III

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
Highlighted
Helper I
Helper I

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

Would it be less resource intensive to put the condition in the Trigger Condition section of the first action?

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

 

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (7,251)