# Not change Ionic toggle value in workflow

**URL:** <https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929>\
**Category:** Need help\
**Created:** [September 14, 2019, 9:20pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929 "2019-09-14T21:20:28Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![kouheiimazu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kouheiimazu/32/46506_2.png) [@kouheiimazu](https://forum.bubble.io/u/kouheiimazu)\
**Post date:** [September 14, 2019, 9:20pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/1 "2019-09-14T21:20:28Z")

</div>

Does anyone know how to change Ionic toggle value in workflow?  
I have tried “set state” and does not work.  
Here is my try.  
I tried changing toggle B value following as toggle A value and failed.  
 ![com-video-to-gif%20(4)](https://us1.discourse-cdn.com/bubble/original/3X/a/5/a568bae33f0f13f0c7b704a166e80a673053a68e.gif)

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [September 14, 2019, 9:41pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/2 "2019-09-14T21:41:01Z")

</div>

Use the conditional Workflows on your main workflow. The ionic toggle has this feature built in btw. Just use autobind.

---

<div class="post-metadata">

**Author:** ![kouheiimazu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kouheiimazu/32/46506_2.png) [@kouheiimazu](https://forum.bubble.io/u/kouheiimazu)\
**Post date:** [September 14, 2019, 9:45pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/3 "2019-09-14T21:45:50Z")

</div>

Do you mean to say I should use database?

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [September 14, 2019, 9:59pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/4 "2019-09-14T21:59:25Z")

</div>

Depends on what you want to do. If you want to do it like the example above, create two different Workflows with conditional statements.

---

<div class="post-metadata">

**Author:** ![eli](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eli/32/42610_2.png) [@eli](https://forum.bubble.io/u/eli)\
**Post date:** [September 15, 2019, 12:44am UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/5 "2019-09-15T00:44:56Z")

</div>

Hi @kouheiimazu, keep in mind the Ionic toggle is itself a boolean. It is always in a state of either true or false. (i.e. “is checked” or “is not checked”)

If you are simply wanting to toggle B according to A, you can reference the element itself like this:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/3/f/3fc26490e8a6cf313488be90ff5b5369c0681de5.png)

By using “is checked” we are creating a parallel boolean state in Toggle B. If Ionic Toggle A is checked, then the condition is true. If it is not checked, the condition is false.

Here it is in action:  
 ![](https://media1.giphy.com/media/LoO62ESNh8Z4p2SrrK/200.gif?cid=dda24d509snaos4026b870vjclaq4ksotiw5ha5zdva90ar5&ep=v1_gifs_gifId&rid=200.gif&ct=g "Animated GIF - Find & Share on GIPHY")

If you want to do it in a workflow, set up a yes/no state like you did. I’ve essentially duplicated how your state was set.

Make sure the preset status on Toggle B is Dynamic and the Dynamic status references the yes/no state you set up.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/e/6/e63736dca81a96cd77083a96ef6953bb1028faf0.png)

Now, let’s simplify your workflow a bit. Use the same An input value is changed trigger but instead of creating conditionals to set the state to yes or no, simply reference whether Ionic Toggle A is checked or not.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/0/c/0ca00466e45a812c2c40cd3627d90e8ef9fecf25.png)

That will create the same result as referencing Toggle A state directly from Toggle B but using workflows instead.

Here is the result:  
 ![](https://media2.giphy.com/media/lri0VwyyEbO8htwX9M/200.gif?cid=dda24d50t0vwpo55hv4n5it4md1z64wfk3fuqovsevs7rx1l&ep=v1_gifs_gifId&rid=200.gif&ct=g "Animated GIF - Find & Share on GIPHY")

Maybe that helps 🙂 Good luck!

---

<div class="post-metadata">

**Author:** ![kouheiimazu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kouheiimazu/32/46506_2.png) [@kouheiimazu](https://forum.bubble.io/u/kouheiimazu)\
**Post date:** [September 16, 2019, 8:03am UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/6 "2019-09-16T08:03:13Z")

</div>

Hi, Thank you for your solution!  
May I ask one more question?

I want make the toggle off from button/text click.  
So I am using workflow with set state following you.  
It works but works just “Once”.

![com-video-to-gif%20(5)](https://us1.discourse-cdn.com/bubble/original/3X/c/3/c3d11878a61751a9565d87c995ac9b55bf3e275e.gif)

Do you know how to make it change every time?

---

<div class="post-metadata">

**Author:** ![meyerhd2](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@meyerhd2](https://forum.bubble.io/u/meyerhd2)\
**Post date:** [September 16, 2019, 10:51am UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/7 "2019-09-16T10:51:43Z")

</div>

When you “manually” change IonicToggleA (to on from off in your screenshot…after you pressed the button), you would need another workflow to “update” custom state castam to “yes”.

As it stands now, on page load castam is set to yes by default. When you click the button, your workflow changes castam to “no”. There is nothing that changes castam back to yes, so it only (correctly) works the one time you told it to.

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [September 16, 2019, 11:01am UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/8 "2019-09-16T11:01:01Z")

</div>

Use only when… in conditional statement on the workflow. You will need two seperate workflows.

---

<div class="post-metadata">

**Author:** ![kouheiimazu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kouheiimazu/32/46506_2.png) [@kouheiimazu](https://forum.bubble.io/u/kouheiimazu)\
**Post date:** [September 16, 2019, 5:44pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/9 "2019-09-16T17:44:32Z")

</div>

Thank you for your reply.  
I have just made 2 workflow for set statement.  
But it still does not running.  
 ![com-video-to-gif%20(6)](https://us1.discourse-cdn.com/bubble/original/3X/a/4/a409f09f98dbcae5a2f13581eef11857a3128f5b.gif)  
Is something mistake available in the workflow?

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [September 16, 2019, 5:57pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/10 "2019-09-16T17:57:16Z")

</div>

Turn them around. When this isnt checked set state to yes. Something it’s good to take a small break and read what’s happening.

Right now you have when ionic checked (yes) \> set state to yes… it should be no.

---

<div class="post-metadata">

**Author:** ![kouheiimazu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kouheiimazu/32/46506_2.png) [@kouheiimazu](https://forum.bubble.io/u/kouheiimazu)\
**Post date:** [September 16, 2019, 6:23pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/11 "2019-09-16T18:23:26Z")

</div>

So, Is the setting correct?

 ![23](https://us1.discourse-cdn.com/bubble/original/3X/3/a/3a8db88bed5a5b43fa3a0921a1edc1267a58ec36.png)

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [September 16, 2019, 6:51pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/12 "2019-09-16T18:51:23Z")

</div>

What do you want to achieve here? The workflow setup is correct but right now you have another issue.

It’s like you’re saying when the door is locked and the door is unlocked, unlock the door. Doesn’t have any added value.

You can not unlock a door that’s already unlocked.

---

<div class="post-metadata">

**Author:** ![kouheiimazu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kouheiimazu/32/46506_2.png) [@kouheiimazu](https://forum.bubble.io/u/kouheiimazu)\
**Post date:** [September 16, 2019, 7:11pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/13 "2019-09-16T19:11:54Z")

</div>

I want make the toggle off from button/text click everytime.  
Do you know how set up is correct?

---

<div class="post-metadata">

**Author:** ![eli](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eli/32/42610_2.png) [@eli](https://forum.bubble.io/u/eli)\
**Post date:** [September 16, 2019, 8:17pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/14 "2019-09-16T20:17:50Z")

</div>

Okay, so the answers above from @nocodeventure & @meyerhd2 are partially correct, you do need to reset the state for it to work, but that is only part of the issue. As you can see here, I have both the button and the toggle flipping the custom state back and forth but as soon as I use the toggle, it no longer works dynamically and only changes upon manual input

The real issue is that when you use the toggle manually it’s PRESET STATUS is overridden. Fortunately, it’s an easy fix 🙂

Right-click on the toggle and click Group elements in a Group

![image](https://us1.discourse-cdn.com/bubble/original/3X/7/1/7192d3cfa67e6a0655870dadb8bcaa74c651a69a.png)

An empty group is fine, no need to set content

![image](https://us1.discourse-cdn.com/bubble/original/3X/c/2/c273fc3b99219e5644d650e8c6b032047324ab7f.png)

In your workflow, simply add a step to reset the group containing the toggle before changing the custom state’s value. This will reset the toggle to it’s preset status and make it dynamic again.

![image](https://us1.discourse-cdn.com/bubble/original/3X/1/0/103c3ed928cb083105a46b47b3bfcbe12b4b9f94.png)

![image](https://us1.discourse-cdn.com/bubble/original/3X/8/8/88204c9c84badb76dce46db79a2799a9ddb6e59e.png)

There you go. Working perfectly!

---

<div class="post-metadata">

**Author:** ![kouheiimazu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kouheiimazu/32/46506_2.png) [@kouheiimazu](https://forum.bubble.io/u/kouheiimazu)\
**Post date:** [September 17, 2019, 8:34am UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/15 "2019-09-17T08:34:15Z")

</div>

YES! It works!  
Thank you very much for your solution!  
 ![com-video-to-gif%20(7)](https://us1.discourse-cdn.com/bubble/original/3X/b/b/bb92cc0a60d2be97a3d75cba2ebaee0b6efbb618.gif)

---

<div class="post-metadata">

**Author:** ![troy.roberge](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/troy.roberge/32/51507_2.png) [@troy.roberge](https://forum.bubble.io/u/troy.roberge)\
**Post date:** [September 22, 2019, 4:51am UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/16 "2019-09-22T04:51:10Z")

</div>

Thanks very much, I just used this reset data solution!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [November 23, 2019, 9:21pm UTC](https://forum.bubble.io/t/not-change-ionic-toggle-value-in-workflow/66929/17 "2019-11-23T21:21:56Z")

</div>

Closed on November 23, 2019, 9:21pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
