cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vidanaw
Helper IV
Helper IV

SharePoint document Publish option is not showing in PowerAutomate

Hi All,

I m in the middle of creating a flow with the condition IF SharePoint document Published True.
But I cannot see the Published option, see below.

Can someone please help me. 

Vidanaw_0-1622002462422.png

 

The flow strting like this 

Vidanaw_1-1622002518135.png

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Vidanaw,

 

Just to double check. You are talking about publishing a minor version (1.1) to a major version (2.0), correct? Or are you talking about content approval status (draft, published, pending, rejected)?

 

In the first scenario there unfortunately isn't a specific field for that to check. What you can do is workaround this by using expression to check the version number field.

 

Below is an expression which you can use. It checks if the number behind the dot is a zero. Which effectively makes it a major published version.

 

 

equals(split(triggerOutputs()?['body/{VersionNumber}'], '.')[1], '0')

 

majorversiontriggercondition.png

 

Alternatively, you could also add that expression as a trigger condition to your trigger actions in the settings. This way only published files will trigger your flow which makes the condition action obsolete.

 

@equals(split(triggerOutputs()?['body/{VersionNumber}'], '.')[1], '0')

 

 

majorversiontriggercondition_test.png

View solution in original post

3 REPLIES 3
Expiscornovus
Super User
Super User

Hi @Vidanaw,

 

Just to double check. You are talking about publishing a minor version (1.1) to a major version (2.0), correct? Or are you talking about content approval status (draft, published, pending, rejected)?

 

In the first scenario there unfortunately isn't a specific field for that to check. What you can do is workaround this by using expression to check the version number field.

 

Below is an expression which you can use. It checks if the number behind the dot is a zero. Which effectively makes it a major published version.

 

 

equals(split(triggerOutputs()?['body/{VersionNumber}'], '.')[1], '0')

 

majorversiontriggercondition.png

 

Alternatively, you could also add that expression as a trigger condition to your trigger actions in the settings. This way only published files will trigger your flow which makes the condition action obsolete.

 

@equals(split(triggerOutputs()?['body/{VersionNumber}'], '.')[1], '0')

 

 

majorversiontriggercondition_test.png

View solution in original post

Thanks, Yes I was after major minor vresion. Thank your help. 

One more question is it possible to use this as a generic W/F for multiple document libraries. I would like to have one flow rather than creating multiple flows for each library. FYI- libraries have different names. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,059)