Hi,
I am trying to build an auto message that will reply to anyone who posts a message after our office hours.
We want it to run only at CDT16:30 - CDT 08:00 the next day. I am okay if we have to manually turn it off ... but do want it to start running every day from 4:30 PM.
I tried to set the Interval 1 and Frequency as Day ... or as you see below every 60 Sec ... but the bot just won't work.
It is not even stuck in the Recurrence but at the "When a new channel message is added" (see 2nd screenshot).
It has a counter running in the "When a new channel message is added", and can't get past it.
Can anyone suggest to me how I can make this work? Thank you.
Solved! Go to Solution.
Hello @minniep
Your flow have to start with the trigger "When a new channel message is added". It will be listening all the time, so no need to use a Recurrence trigger.
In the trigger "When a new channel message is added" is provided a date time value for when the post was created. Using that date time value, the autoreply can be setup to reply or not. I have made a little example that may be useful as a starting point for you:
In the example, a variable Time is intialized with the hour and minute value from the createdDateTime value and turned into an integer. This will give values from 0 to 2359. A Condition is then used to check that the Time is greater than 1630, meaning after 04:30 PM or less than 800, meaning before 08:00 AM.
In flow, date time values are always in UTC, so in the Time variable I convert from UTC to CDT.
Hope the above helps a little 🙂
Kind regards, John
Hello @minniep
Your flow have to start with the trigger "When a new channel message is added". It will be listening all the time, so no need to use a Recurrence trigger.
In the trigger "When a new channel message is added" is provided a date time value for when the post was created. Using that date time value, the autoreply can be setup to reply or not. I have made a little example that may be useful as a starting point for you:
In the example, a variable Time is intialized with the hour and minute value from the createdDateTime value and turned into an integer. This will give values from 0 to 2359. A Condition is then used to check that the Time is greater than 1630, meaning after 04:30 PM or less than 800, meaning before 08:00 AM.
In flow, date time values are always in UTC, so in the Time variable I convert from UTC to CDT.
Hope the above helps a little 🙂
Kind regards, John
Thank you @JohnAageAnderse
I had never created a condition before.
Can I add the Compose (Message ID) > Post a reply (Outputs) inside the "If Yes"?
or do I have to add the Apply Each inside the "If Yes" before I add the Compose and Post a reply (like I did as per screen shot in initial inquiry.)
Hello @minniep
You just add the compose and post inside the Yes branch. That should be enough.
If there is a need for the Apply to each, the editor will normally add it automatically, but I think it will not be dong that in this flow 🙂
Try it out and tell us about it.
Kind regards, John
Thank you @JohnAageAnderse
I am still getting this error in the Initialize variable:
Hello @minniep
Yes, the expression has "createDateTime", is must be "createdDateTime" 🙂
Kind regards, John
Thank you @John
I had corrected the formula to
Another weird thing happened.
When I was testing the auto bot in one channel, it showed the condition as "Cancelled" when I message outside the time frame
However, after I moved the automate to the channel I wanted to apply, the condition will show as "Failed" when I message outside the time frame. Is that normal?
In addition to the difference between Cancelled and Failed status for the condition, I am also facing another challenge.
Not sure if you and other experts can take a look.
The auto-reply sometime works right away, but most of the time it delays by 2- 3 minutes.
Here is the image of how I built the flow:
Hello @minniep
The reason for the flow to fail is that the value "0800" used in the condition "is less than" must be "800" and not "0800". With the zero in front, flow thinks that it is a string value. Removed the zero and it will think that it is a numeric value and thus can be compared with the value in the Time variable, which is a numeric value 🙂 After that correction, the condition will work as expected.
About the flow reaction time, that is controlled by Microsoft, not something we can affect, as far as I know.
Kind regards, John
User | Count |
---|---|
90 | |
41 | |
22 | |
20 | |
16 |
User | Count |
---|---|
134 | |
54 | |
47 | |
36 | |
25 |