Page 1 of 1

inefficient email sync flow?

Posted: 11 Oct 2017 09:21
by luke77
hi there,

i've got a simple flow (attached) which turns on and off the sync to a work gmail account at different times, it works well but i have a couple of issues - i'd be grateful for any advice.

the idea is it should sync all time except...

- Monday to Friday between 17.30 - 08.45 am
- Saturday and Sunday off from 17.30 until 08.45 am Monday

couple of questions...

1) is the 5 minute periodic check necessary? or is there a more efficient way for it to 'know' what time it is?! (ie 'flavour flav' mode?! :D )
2) on a Monday morning it syncs early, i think because of the Sunday midnight rule... how can i get around this with the least number of decisions?

thanks kindly for any tips!

cheers,

Luke

Re: inefficient email sync flow?

Posted: 11 Oct 2017 17:02
by Desmanto
luke77 wrote: - Monday to Friday between 17.30 - 08.45 am
- Saturday and Sunday off from 17.30 until 08.45 am Monday
I don't understand those two bolded sentences. Don't they mean everyday?
It seems the better phrase is you want to sync the email everyday, only from 08.45 - 17.30 (sync email during working hours, including saturday/sunday).
Use negation wording only for the special exception.

Don't use time range as the trigger. Time range only used to check extra state/condition for other trigger. If you rephrase the wording, it is more logically to say
When : time is 08.45
Do : turn on email sync

When : time is 17.30
Do : turn off email sync.
So the trigger is time, not period timer. No condition needed, only two triggers with two actions in two flows.

Since both flows only has single action, it will be wasted to keep them in two flows.
Better combine them together and check the trigger using extra condition expression.

Trigger 1 : Time: everyday 08:45
Trigger 2 : Time: everyday 17:30
Condition : Expression

Code: Select all

trigger == "Time: everyday 08:45"
Action True : Set Auto Sync on for certain email account
Action False : Set Auto Sync off for certain email account.

To add new trigger, after adding trigger 1, tap the trigger and tap the 5 line icon on the top, tap new to add the 17:30 trigger.