How to get user variables as magic text (external users table)

Welcome to Adalo, so problem is you don’t understand magic text?

1 Like

Hi Valentine, welcome to the community.

If you are able to use the logged in user data in lists, then the data should be available on all pages. Could you send some screenshots or a small screencast to see where is might be failing and also to see what fields you have in your external user database. Thanks

1 Like

Thank you!

Here are three screenshots:

  • One shows that my external collection variables are detected by Adalo.
  • A second one shows where I expect to see those variables but I only see ID and Auth.
  • A third one shows a list component that sees those variables, so I must be misunderstanding something about Adalo.

How can I get, say, a text component to include logged in user variables?

Hi there @crmorris2 and @B0untiful_26 - Thanks again for the reply. Any guidance to the screenshots?

To make the text have the user name, do this "Hello, and choose “first” and then “last”, to make that passible “Logged In user>First” and repeat “Logged in user>Last”

Those options are not available. As shown in the screenshot, my only options are
Logged In User > External Users Auth,
Logged In User > External Users ID

Try this…

Unfortunately, it doesn’t have the variables

The database should have that icon for the users.

image

Do you have that?

@B0untiful_26 he doesn’t have that becuase he is using external users.

2 Likes

@valentine Here’s what I am doing to workaround with this issue:

  1. During Login, I create a temp collection within Adalo for user profile using “Get” Users and store the name & email
  2. Use that information on the home screen to show “Hi, Dear User[Name]”

I know it’s not ideal at the moment, but it does work for now :slight_smile:

2 Likes

OOH, makes sense! :slight_smile:

@bhanu Oh! Is this a limitation of the current External Collections beta?

That’s an interesting workaround, Bhanu. Thank you. Can you explain the steps?

@valentine yup, that’s the current limitation, when you setup external collections in Adalo, there are only 2 things you get in return, External Auth Token & External User ID, so there’s no way to access the name & other details from DB.

As a workaround, the approach I am taking is to to perform a custom action upon clicking login before sending to Home Screen.

Here’s the sequence:

  1. Login
  2. Custom Action > Get Users from Xano > since you’re doing this as logged in user, you’ll get signed in users record
  3. Create a temp collection in Adalo with required details (i.e. name, email, phone # etc.)
  4. Now when you move to Home Screen after successful login, you’ll also have the new collection data along with Auth ID and Auth Token
  5. Show “Hi, “ on Home Screen from the data you just stored in temp collection.

You’ll have to perform some cleanup from time to time to clear the temp collection.

Hope it makes sense.

3 Likes

@bhanu Thanks for sharing this workaround - trying to figure out how to implement this.

I assume you are saying to add a custom action to the “Login” button. Is that an update action? I’m guessing the API endpoint would be the

/user/{user_id}

How do you pass the user_id to that parameter?

@HalAtkins yes custom action on login button.

It’s a Get Users from Xano request, so you should be using create

Don’t need to pass the user_id as @xano recognizes the authenticated user already.

I used Get Users collection without passing the userid and it worked just fine.

2 Likes

Sorry Valentine, I have been away from Adalo for a few days. Looks like @bhanu offered you a workaround.

Cheers

1 Like

@crmorris2 I’m still a bit lost on how to lay out the solution offered. If anyone could help with a bit more detail on how to do this, that would be great!

1 Like

This comment explains it quite clearly How to get user variables as magic text (external users table) - #16 by bhanu

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.