Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Posting news in Sharepoint. Flow triggers only once in Draft state

(0) ShareShare
ReportReport
Posted on by 21

Hello

 

I created new Flow for the Sharepoint site, which should send an email when new post is Published.

But it doesn't send an email if the post is in the Draft state already. As I understand my Flow already triggered, when the new post swtched to the Draft state and after that when I press publish button it doesn't trigger.

It does work when a post still isn't in the Draft state.

 

Could you plese tell me how can I fix it?

 

Thanks

Annotation 2019-06-26 110437.jpg

 

  • zigfridus Profile Picture
    21 on at
    Re: Posting news in Sharepoint. Flow triggers only once in Draft state

    I'm very sorry for the delay.

    I've got another important task and have to complete it.

    After that I'll try to do that You adviced me.

    Thanks

  • Pstork1 Profile Picture
    65,997 Most Valuable Professional on at
    Re: Posting news in Sharepoint. Flow triggers only once in Draft state

    I played around with it a little since John's post is for List items.  Here's the right REST call

    https://acmee3.sharepoint.com/sites/FlowDemos/_api/web/GetFolderByServerRelativeUrl('SitePages')/Files('Home.aspx')?$select=FileLeafRef,UIVersionLabel

    Two changes from yours.

    1. Remove the slash form Site pages.  It needs to be server relative not absolute.
    2. retrieve UIVersionLabel.  If that value is a whole number its major (ie. 1.0, 2.0, 3.0)
  • Pstork1 Profile Picture
    65,997 Most Valuable Professional on at
    Re: Posting news in Sharepoint. Flow triggers only once in Draft state

    Take a look at John Liu's blog post on getting the version number.

     

    http://johnliu.net/blog/2018/5/microsoft-flow-sharepoint-trigger-on-specific-fields-changed-via-sp-http-request

  • zigfridus Profile Picture
    21 on at
    Re: Posting news in Sharepoint. Flow triggers only once in Draft state

    Thank you for your answer. I've tried to get the file's version from HTTP request but it wasn't successful. 

    Could you please tell me what is wrong in this request:

    _api/web/GetFolderByServerRelativeUrl('/SitePages')/Files('FullFileName')?$select=FileLeafRef,OData__UIVersionString

  • Pstork1 Profile Picture
    65,997 Most Valuable Professional on at
    Re: Posting news in Sharepoint. Flow triggers only once in Draft state

    Here are two workarounds that should work.

    1. You can retrieve the current version # of the document using the Send an HTTP request to SharePoint action. Then you can have your FLOW only send the email when a major version is published.
    2. If you run the FLOW connector as an account that only sees the major versions then the File create Trigger will only fire when a major version is Published.

    I suspect #2 is the better choice but it means creating and running the Flow with a different user context that has lessor permissions to the site. Not sure if that's convenient.  #1 will also work but it requires changing the trigger and will lead to more Flow runs.

  • Pstork1 Profile Picture
    65,997 Most Valuable Professional on at
    Re: Posting news in Sharepoint. Flow triggers only once in Draft state

    The only real difference between a draft and published is that the published version is a major version and the minor version is draft.  Taht means the when a file is created won't fire when the page is published.  YOu'll need to change your flow to fire when the files is created or modified and then check to see if the version is a major version or not.

     

    The problem is I don't know any way to retrieve the current version number of the document.  So I don't know how you determine whether this is a major published version or not.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow