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')

 

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')

 

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 186 members 5,619 guests
Please welcome our newest community members: