Getting data from a specific cell in DB


I'm probably missing something fundamental and I am quite new to Retool and coding in general. But my issue is that I want to get data (string or number) from a specific cell in my DB table. If I use the code {{}}, the return in my case would be data from multiple row which makes sense. But how do I get the column data for on specific row? For example, I want a string with the data from column 3 in row 12 in my_table.

Hope that this was understandable. Thanks!

The best way to explore what you can use from another table is to add another "." and see what pops up! It also depends on what you are trying to use it for. If you want to use it as an entry for something else to go off of, I would use {{}}.

What are you trying to do with the data you are trying to access? Some context would help!

Yes I did do that but I did not find anything from what I could see.

I will use it for two purposes:

  1. To get the value from that one cell to show as plain text on my mobile app.

  2. Use it in a query and substract itself with a number defined in a number input, and then trigger to update itself in the database. I think I have the equation figured out exept from the problem stated above: {{ - numberInputX.value }} should probably do it. So it also need to be defined as a number (hence the plus sign in front).

Hope this was more understandable! And thanks for the reply

So {{}} did not work for you? I want to make sure you noticed the as your example does not use the but rather just .data where you see all the columns as you mentioned.

If you are going to use math like your example, you might need a transformer which you can find your source options. Something like:

math = {{['0']}} - {{numberInputX.value}}
return math

Wouldn't selectedRow require me to actually select a row for it to return a value? I want the row to be a constant in my code. For even more context, the table contains 8-10 items for tracking inventory quantity

@Tashina_Taylor I take it that you don't know how to help me further?

EDIT: Never mind, I found the solution. The code I was looking for was simply {{['5']}} where 5 refers to the table row ID.

1 Like