Issue: I am having troubles to pull out all users at Retool, because I need current_user object information
Steps I've taken to troubleshoot: None
Additional info: (Cloud or Self-hosted, Screenshots) : Not an enterprise account, so I can’t access API
Context
So I have this situation where I am building a backend. The backend with permission system have been set up, but right now I don't have ways to get all users from Retool app I'm building
Since Retool’s login page doesn’t let me control, usually we can hook frontend and backend easily, but there is an integration system issue. Since Retool manage frontend, how could we send users’ information to the backend?
currently, endpoint only verify id based on current_user.metadata.user_id I have looked around the potentials but there seemed none solutions.
My potential idea would be we can have a user table inside the app, then we can pull data from Retool into the table, so then we can send reuqests with every informations inside the table to the backend, so then we in fact keep both system sync.
you should be able to use the metadata like you mentioned and provide each user with a unique id and then pass that in your query.
here’s a relevant line from the Retool Docs here
You can create and add attributes to users to enable custom experiences in Retool. Admins can create and apply attributes to any Retool user. When building Retool apps, you can reference attributes through the current_user object to control functionality. Attributes are secure by default: bad actors cannot spoof data passed into queries that reference attributes.
you could also potentially just use current_user.email as retool requires this to be a pkey, but if you want to have a users table in your DB it might be easier to have a related id. Let me know if you have any questions!
No what you described is the second step. you need to first get and store all data first before you even use current_user object to verify them. @DavidD
The Retool's endpoint to get all users is gated to Enterprise, so unfortunately that's a no go.
When you have a Business subscription, the recomendation I always give is:
-- Create a Retool app for adding new users to the account. At a Business account you have access to the send_invite endpoint, which allows you to set metadata and groups when you send the invite.
-- At the same time the invite is sent, create a record in a db with user details, and any other business info you may want to add to that user
-- Edit your claim_invite app so that when the user claims the invite and logs in for the first time (this is when retool's user_sid is generated) you update your users table to add the user_sid
-- With the user_sid you can now use the edit attributes endpoint to edit users, without having to go to retool's settings UI
With this, you have an app with all of your users, linked to retool's user_sid, metadata and groups.
yes, we only are Business account, so that is good to know, but how do we know those users that are already in? your ideas seem it is the first time to invite users to Retool.
wait, I may not understand your correctly, does `send_invite mean the web app we created to send invite or does it mean invite Retool itself ?