Undefined variable

While the variables exist in my retool database postgre SQL.

I'm getting the error of undefined when I try to fetch for default value. unable to figure out the error. where is it that I'm going wrong

Screenshot 2024-09-10 at 3.15.48 PM

1 Like

HI @Vinyasa_Health,

{{current_user}} is a predefined retool variable which takes the information provided when creating/editing your retool account.

What you're showing is a retool database for a user. What you could do is create a query that fetches your user data by filtering it by {{current_user.email}} and then use the result of your query to fetch your user's professoin (and any other relevant data).

Hope this helps, let me know if you need additional context!


I did already run that query.

@MiguelOrtiz, I did run the query already. Can you help me figure out where is it that I'm goingwrong

Hi @Vinyasa_Health,

You're running that query in the query library, rather than in an app, that's why you won't be getting any result. Have you tried it in an app to see if it brings the results you're expecting?

I ran it in app as well. I'm getting the output as well/

Ok cool, so within your app, you can now see the results of your query and yo ucan use {{fetchTherapistProfile.data.profession}} and you'll get the value you're looking for.

With that as well, I'm getting only some of the field which I populate. however, fields with rich text are not being read

Hi @Vinyasa_Health,

It would be helpful if you can share screenshots of what you're trying to do and a bit more of explanation.

I was able to solve it through. thank you so much

2 Likes

So glad you found a solution @Vinyasa_Health :raised_hands:

If you're open to it, consider adding how you solved your issue for future users :slight_smile: