How to lookup id on table B and output value from tabel B

Hello,

I have already tried to find something in the docs. If you have a link, I would be thankful.

Instead of showing the ID (1, 2 …) in column, I would like to look it up on another table and output the value for ID from this other table. I have already used the data formatter to format a date field, but right I am scretching my head how to subselect and show/replace the ID number.

Hello,
You need to use table joins here.
In the query builder in server connect, add your other table to the currently added one. A join table dialog will appear. Setup your join settings and then output the field from your other db table on the page.

1 Like

thank you.
i left joined the other table and set the joined value for cell in bootstrap 4 responsive table.
this did work, but it limits my result to 1 data line only.

how will adjust the limit later with pagination.
for now i would like to see all data.

Might have to show some screenshots of it, if you did a left join though it should be showing all the data from table A even when there is no corresponding data on table B.

thank you psweb.
your hint about checking the actual SQL was a good one.

The SQL still had the JOIN RIGHT instead of JOIN LEFT and I picked the wrong equals for lookup.
I need to do more double checking :wink:

@WatchThatCode congrats ! you could also prepare Views on DB Level/Phpmyadmin

I might add views in MySQL later. Thank you for that hint.
Right now trying to catch up with the new workflow (Wappler).

i noticed, that the column doing the lookup on another table (first column) behaves kind of strange when it comes to sorting. Could it be, that Wappler wants to sort the actual value (id) instead of the lookup value (text/name).

Try to show ID in a column or somewhere for debugging reasons. You can remove it when everything works.