Display user informations in user reference id automatically

Hey there, Newbie here with another simple newbie question!

A user should be able to add a comment in the front end like in the video (https://www.youtube.com/watch?v=xJed9iJfY9Y&t=403s). What I need is that in the user_id column of my comment table automatically display the informations “# user_id” and “name” of the user who wrote the comment.

All inputs are successfully posted in the comment table but the user_id field is empty. I can manually add “# user_id” and “name” via double klick but there is a way that this is going to happen automatically, right?

I am authenticated with the WeWebAuth Plugin and every time I submit my comment in WeWeb I look into my Logs and there I can see that my workflow is done but the user_id is 0 (which is not my # id)

Hi @Adrian :wave:

Not sure I understand your use case.

A few questions for you:

  1. you are using WeWeb Auth and what backend?
  2. can you show us screenshots of what your database columns look like?
  3. can you show us screenshots of the workflow action in WeWeb that is making the update, specifically, how the user id and user name are bound?
  4. what do you mean by this? :point_down:

Hi @Joyce

  1. I am using WeWeb Auth and Xano.
  2. Pls look at picture 1
  3. Pls look at picture 1
  4. Pls look at picture 2


I hope that helps to understand my case. I’m sure it’s probably totally simple, but I just can’t figure it out.

I already tried to add another “user” key in my WeWeb auth Workflow which is linked with my current authenticated user, but this won’t work too. Also my id look pretty weird :smiley:

Thanks @Adrian!

So if I understand correctly, in WeWeb the field user_id is bound to WeWeb Auth - ['user'].

Is that correct?

If it is, that’s where the issue is coming from. You want to be sending the id of the user to Xano, not the entire user object.

Does that make sense?

Quick question by the way: may I ask why you are using the WeWeb Auth plugin instead of Xano Auth? Since you’re already using Xano as a data source, the integration with Xano as an authentication system would be smoother and more powerful.

Yes I want to send the id of the user to Xano and I already tried to bound “WeWeb Auth - [‘user’].id” but then I get a Error 400 with the following:

response: “{“code”:“ERROR_CODE_INPUT_ERROR”,“message”:“Value \u00223b05f68a-7ca3-4650-ad25-42f196ae3491\u0022 is not a valid integer.”,“payload”:{“param”:“user_id”}}”

I am completely new in this and just followed your examples in the WeWeb Academy and thought this would work for now. But maybe I change my authentication system to Xano if this is smoother and more powerful…

Thank you, I am now working with Xano’s authentication system and everything works fine! :smiley:

1 Like

Awesome! Nicely done, Adrian!

Ah yes, the academy videos are meant to be “backend-agnostic” to serve a wider audience but this can be confusing at times.

We’ll be releasing a dedicated “Build with Xano mini-course” in Q1 2024 to help new users who’ve already chosen Xano get to grips with the data source and authentication integrations more smoothly.

1 Like