How to Stop flow when condition is fullfilled

Post your questions and help other users.

Moderator: Martin

Post Reply
Wolf63
Posts: 21
Joined: 04 Sep 2018 20:56

How to Stop flow when condition is fullfilled

Post by Wolf63 » 11 Sep 2018 20:48

Hi. How can I stop the flow, (contact anouncement by speech during incoming call) when I accept the call, the anouncement should stop. My flow doesn't. The anouncement goes on. Change the options changes nothing. See screenshot. Thx
Attachments
Screenshot_20180911-224027.png
Screenshot_20180911-224027.png (265.01 KiB) Viewed 15953 times

Wolf63
Posts: 21
Joined: 04 Sep 2018 20:56

Re: How to Stop flow when condition is fullfilled

Post by Wolf63 » 12 Sep 2018 17:52

I'm proud to say, that I solved the problem by myself. Ist wound be very helpful to put the list of components ie actions, to the main menue. I found it by chace under the point "general". Hope the devellopers will read this comment...

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: How to Stop flow when condition is fullfilled

Post by Desmanto » 14 Sep 2018 16:51

It helps a lot when you learn to solved it by yourself first. But you can always ask here in case of dead end. I am quite busy these several days, that I already want to reply but disturbed by some other activities.

The caller name and repeat until picked, have ever been solved already in another thread : viewtopic.php?f=5&t=7334
You don't need so many action, you can simply loop them and check it using condition. Or in the above link, use trigger for better result.
You can find more at my index, section Call.

List of component in main menu? When you add the action > new, you can find all the available actions. In case you need the full documentation, you can visit my index, at the General section. I have linked most of the useful documentations by automagic itself.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Wolf63
Posts: 21
Joined: 04 Sep 2018 20:56

Re: How to Stop flow when condition is fullfilled

Post by Wolf63 » 14 Sep 2018 17:45

Thank you very much,that you dealed with my problem. I solved it as you see in the picture. First 3 times caller name, then 1 time incoming number, then 2 times caller name. I find my way very elegant. Thank you for the answer. In the main menue should be an anouncement, that you can find all the actions under the point general. It's not easy to find. Have a nice evening!
Attachments
Screenshot_20180914-193448.png
Screenshot_20180914-193448.png (240.58 KiB) Viewed 15859 times

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: How to Stop flow when condition is fullfilled

Post by Desmanto » 16 Sep 2018 09:44

Actually the flow can be more efficient and much shorter. You only need to change the Call State to detect Ringing.
If Ringing, True, go back to the speech output. False do nothing. The result is just like below.
Caller Announcement.png
Caller Announcement.png (47.3 KiB) Viewed 15835 times
The flow only active when call ringing. It will loop speak out the caller name. If the call state still ringing, it will loop infinitely. Once the call state is idle (missed call) or picked up (off hook), the flow stop.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Wolf63
Posts: 21
Joined: 04 Sep 2018 20:56

Re: How to Stop flow when condition is fullfilled

Post by Wolf63 » 16 Sep 2018 13:56

Ok. But in my flow after the third time of the callers name announcement, the callers number is announced, than again the callers name for again 2 times, and not for infinite. That's the difference to your flow. So it must be included in the loop to run only for three times, then go to the next action to announce the callers number, then again to the flow to announce callers name for 2 times then stop. I didn't find another way as mine. Thank you for thinking about my flow!!!

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: How to Stop flow when condition is fullfilled

Post by Desmanto » 16 Sep 2018 17:51

Ooops, sorry. I don't pay attention to the {incoming_number}. It would be better if I just use the english version of the flow. :)

You can still do it using loop. There is a condition using execution count, which will evaluate to true as the flow pass to it until certain value. You can use 3 with timed 10s, which mean the 3 pass in 10 seconds. Loop it as such that, every 3rd pass will be evaluated to true, and go to the true branch, announcing the incoming number.
Caller Announcement.png
Caller Announcement.png (68.79 KiB) Viewed 15803 times
1st loop will announce name. Since execution count reset in 10 seconds, the 1st and 2nd pass will be false, hence aanounce the name 2 times again (total 3 times). 3rd pass will be true, hence announce number. 4th and 5th are false, announce name; 6th true, number. And it repeat until stop ringing.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Wolf63
Posts: 21
Joined: 04 Sep 2018 20:56

Re: How to Stop flow when condition is fullfilled

Post by Wolf63 » 16 Sep 2018 19:10

I must say, that this way is more elegant than mine. I will try to programm it, hope I will find the condition in german. Thank you for the help!

Post Reply