How do I extract the user name from the user_id? Xano-Weweb table

Have a table in Weweb and using Xano back end. The table in Xano has a table reference to the user_id.

In Xano the user_id displays email, name and id number of the user.

How do I extract that data when I bind it to the text in my WeWeb table?
I want the name of the user but all I get is the number.

userid2
userid

Thank you
Steve.

In Xano you need to embed that referenced data into the request.

When you usually reference in XANO, by default, you get the id of the reference. One simple way you can do is to add the user_id as reference and then create an “addon” from the user table and use it to associate with user ID. In the addon, you can choose which fields to return in the response.

Example of an addon with just returning the user namein “_user” - “name”

image

The actual JSON response in Query all records:

image

1 Like

Thank you, I tried to follow a video on how to do this but Im either doing something wrong or I dont get the options you have. I only get the option to add “sorting”



Im not sure its the right way but I figured out how to get it to work.

Im not sure how to explain it but its for leaving feedback.
When the person logged in leaves feedback its sent to xano. To display that persons details in the feedback table it I thought I could just pull the name, company etc from the user_id but instead I sent the name and company etc from weweb to the xano table along with the feedback and then read in those separate columns back into the weweb feedback table.

Im not sure that makes any sense but it works

You need to create the addon and select the fields you wanted to display. Usually when then you select the addon and save. The last step you show is just to map both tables together once saved, it should show the new fields in the response.

Either case, glad that you found a solution.

1 Like