Boolean object for Dataviewer list

I’d like to show some boolean values from a DB in a datalist or datagrid.
How can I do it?
It seems that a button can’t be linked to any data from data source so it is not a real boolean object but act only as a trigger.
So I’ve tried to simulate it using a label but I don’t want to show 0 or 1 like the stored value but a color or a letter basing on the boolean value.
For example 0 matches with a X or a red background or both
1 matches with a V or a green background or both.
Is it possible with dataviewer component or should I have to make my list using cloning function and if cases to convert boolean?

1 Like

Can you add another column in your table which you fill with the required information and use it in the DVL.

For example if the Boolean column is 0 then this column should be X. You will do that as part of the “save” function in your code.

So you are confirming that there is no way to have a boolean object getting values from DB but I always have to insert some code to manipulate it (in DB or in thunkable), right?
No way to have a check box or something similar without inserting a loop for every record.

1 Like

No, I’m not saying this. I’m saying there is a valid way that you can use existing DVL (Data Viewer List). To check if the Boolean can be linked in DVL you need to create a custom one with a switch and then bind it with the right column. This is too much to do. That is all what I’m saying.

1 Like

SWITCH! Oh my GOD SWITCH is the magic word!
Maybe this is the element i was searching for.
I’ve searched for Checkbox, indicator, led, but not for switch.
I’ll have a try :wink:

1 Like

Too early :frowning:

I’ve tried with a switch, but when i click the switch every switch of the list change values!!
Take a look here:
Moreover it seems not to trigger the item click even if I click on the label

This isn’t quite right but it’s getting closer…

But in my effective list I have more than 20 items :frowning:

I thought the first block alone (with the row id’s value) would be enough for it didn’t seem to work for me. A loop might be needed but I couldn’t figure out how to properly reference the row id of each of the other rows.

1 Like

I’ve noticed when Button or Switch was added to the DVL, it prevented any action in the Item Click. I tried in a number of ways. The same code works for a label but does not have any effect when one of these components is added.

I tried using the Button Click but it seems it can only execute something outside of the DVL and does not make any effect on the components inside the DVL.

I might be mistaken or confused but this is what I observed so far.

1 Like