Question on Table Data Query

Good morning Team,

I have created a button in a view that is used to put our system cranes in/out of manual mode.

I created a named query that is used to update the table for a boolean result with a very simple query.

This query/button work great. The problem is that on occasion the button is not synced with the table.

I decided to write a query to return the boolean value from the table and bind that to the button text using scalar result.

My issue is that i cannot transform the scalar value into a string value.

Question:

  1. Is this the best way to make sure the button is updated to the correct state when the page is opened?
  2. Is there a way to transform the scalar vaule?
UPDATE storage
SET data = :dataValue 
WHERE attribute = 'auto-picking'

image

I think a map transform is what you're looking for.

I was using the map transform but it would not transform the scalar.

I did not have a problem using the map, but you could also use an expression transform
toBoolean({value})

  • or -

You could chang ethe data type of the table column to boolean and forego the transform altogether.

Great idea, unfortunatly i will need the transform. The author of the table has the filed as VARCHAR(45) with string data in it as well as boolean.

Varchar, eh? Try putting quotes around the 1 and 0.

We can skip the choice words I have for the author. :wink:

1 Like