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
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
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.
Take a look at John Liu's blog post on getting the version number.
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
Here are two workarounds that should work.
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.
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.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional