I have an automated flow for sending an email out when a new/announcement page is published on my sharepoint site. This worked 1 month ago when it was last used so I'm not sure what happened that it broke in the time no new posts were published. I checked other posts on this matter but can't determine the issue since nothing about the flow was edited since the last time when it worked.
This is the error -
And this is the flow:
The property "promoted" is definitely "2" when I checked in SharePoint. The one from March 6 is the last one sent, and for which the flow worked. The most recent page "The Smart Equitable Commonwealth..." is the one that didn't.
Solved! Go to Solution.
Hi @SuchitaC ,
Please try to add a @ in front of the expression:
Hope this helps.
Best Regards,
Hi @SuchitaC
Couple of things to check.
1. Did you tried to resubmit the data? Open the relevant history run and click resubmit.
2. If that works then most likely you are hitting with a timing issue. Your trigger is 'When a file is created'. Behind the scene meta data is getting ready and flow executed the next step immediately. In some cases it works and some cases it won't. So to overcome this issue add a one minute delay after your trigger.
3. Also I have noticed you have an IF condition comparing against a numeric value. Not sure your SharePoint column type is integer or not. Use an expression (int()) to convert the 'Promote State' value to integer, so that both end of the conditions it is comparing the same data type.
Let me know how it goes.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @abm
Thanks for your response. Here were the results:
1. Tried, didn't work.
2. Moot, but I added a delay to test anywayand still didn't work.
3. The column type in SharePoint is indeed an integer.
Upon further research, I think the issue is that I need to set a trigger condition, rather than addition the condition after the trigger. "Promoted State" is 1 when a news announcement is created in SharePoint, and then becomes 2 when you post it. I think the issue with my setup right now is that the flow begins as soon as a file is created, and therefore it fails to meet the condition of Promoted State = 2 because of the time it takes to finish setting up the page and publishing it.
I'm very new to this, so I don't know how to set up the trigger condition or the syntax for writing that kind of thing. Promoted State is a default SharePoint column, and values can either be 0, 1, or 2. Is it possible to write a trigger condition for this?
Hi @SuchitaC
Thanks for the reply.
You can add the trigger conditions under the settings of our trigger.
Above I have used the body/Name as a reference. In your case you need to change the column name accordingly.
Please see this video (Reza Dorrani)
https://www.youtube.com/watch?v=j-gP-E6CCE4
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThat didn't work either unfortunately. It produced the following error:
The power flow's logic app flow template was invalid. The template condition expression 'equals(triggerOutputs()?['PromotedState'], 2)' at line '1' and column '6617' is not valid template language expression.
I tried some other variations but I kept getting the same error.
I did eventually figure out a work around though that got this flow working for now. It's a rather roundabout method but it accomplishes the task!
Hi @SuchitaC ,
Please try to add a @ in front of the expression:
Hope this helps.
Best Regards,
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
12 |
User | Count |
---|---|
127 | |
54 | |
38 | |
26 | |
21 |