Click on text to reveal full body!

Hi!
I’m trying to achieve this simple feature:
User clicks on a list item → Textbox visibility turns on.
User click on the list item again → Textbox visibility turns off.

The way I thought I could implement this was to give the list collection in the list a boolean property and turn that on and off via an action - and connect the visibility of the text field to this boolean.

Example:
The list on the right has the true/false property: “Expand text”
It goes to “True” if you click on the list item. It all works this far, but I can’t make it go back to “False”


If I make another action that turns it to “False” both actions run simultaneously.
I tried using the “This action will only happen if…” but it contains no reference to the “Current DB” I am using.

The same effect can be achieved by a toggle button, but I don’t want a button for this, I just want the text area to be clickable.

I tried using an invisible simple shape behind the text in the list item - in order to emulate toggle behavior by setting the click action to “True/False”, this time to my surprise the “This action will only happen if…” let me reference the “Current DB”
I tried setting it to “True” on click action only if it is already “False” and the oppocite: Set to “False” only if it is already “True” - But it still didn’t work.

In short:
I want the list item to behave like a toggle button - or some other solution to click an area to hide/reveal text.

Any thoughts on this? Help is greatly appreciated.

Seems I figured it out! Or at least something that works for now.

Solution was to set a click action on the newly revealed text which would reset the boolean!

I would like to find some way to make the list item work as a toggle though.

You can add a boolean property to the User collection TMPClicked. On click if it is false, change to true. If it is true, change to false. Then base the visibility of Current Punkt on TMPClicked.

1 Like

Does not seem to work.
I tried doing something similar but with the True/False property a part of the Punkt collection.

The text field that I wish to reveal does not seem to respond to the user property.

Even with the “if” statement it seems like it is cycling both actions.

You need to have 2 identical buttons, one on top of the other and then set their visibility based on true or false and add an on action to one and an off action to the other.

1 Like

You can use a switch button with 0 alpha color. (It will be invisible but cliquable) On the top of your text.

You can link 2 différents actions to “switch ON” and “Switch OFF”. I used an input to save the state of my text but if you are inside a list you need to change a data inside a database. (Because you want to have one “switch value” by item) . You will need the ID of the item to change this specific value wich trigger your text visibility.

Example :

How to create an invisible switch button :

1 Like

This is a great tip! Thank you. Very well presented too. I did not know that invisible switch buttons could still be clickable since some other objects does not function in the same way.

This is also a good option!

If you use the “visibility condition” you cannot clic on your button. On my example, the button isn’t “invisible” I just use a 100% transparent color. The result is the same, but with this technique, it is cliquable =)

1 Like