Correct query.. or parse return.. please help. #14451
-
Hello and welcome. SELECT cenakatalogowa FROM c_sc where indeks='SCR-FME90-ZIIIP-95-SERGE-1250-1500'; More specifically, I would like to get the price of a product with a given SKU from the products table. I have an answer for example : How to properly construct a query - or parse the result using js - to obtain the expected result - e.g. the price itself in the input or in the table. ---> 1379,24 Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @zimart Is the puzzle that you're getting a string back from your query it should be a number? If so, in the Data tab when configuring your query, click "Schema" in query results, and you'll have some options to change the data type. (This image is taken from an old project where I followed along to a tutorial, so query names and exact structures might not match your specific use case) If you want to take that value returned and use it in a form field, you could set it in state: In this example, it's set with a button click. Add an action to the button click to run the query Then add another on-click action to Update State In the bindings drawer, you'll now see that you have access to the Actions binding And you can set the value of state to be the price you got back from the query. And then you can use that state variable to populate a form input (or anywhere else you can use the State binding :D) Hope this helps. If you've got any other questions, or if I've just completely misunderstood, please reach out and I'll see what I can do. |
Beta Was this translation helpful? Give feedback.
Hey @zimart
Is the puzzle that you're getting a string back from your query it should be a number?
If so, in the Data tab when configuring your query, click "Schema" in query results, and you'll have some options to change the data type. (This image is taken from an old project where I followed along to a tutorial, so query names and exact structures might not match your specific use case)
If you want to take that value returned and use it in a form field, you could set it in state:
In this example, it's set with a button click. Add an action to the button click to run the query
Then add another on-click action to Update State
In the bindings drawer, you'll now see that you have access…