Automatically refresh metadata of current_user

  • Goal: Ensure updated user attributes (metadata) from the Retool API are refreshed within the same app session without requiring a page reload.

Hi Kapil! Can you please give more context like are you using retool database or REST API or what?

I am using REST API.

Could you share what specific user metadata you're trying to access and where it's stored?

I am storing the auth token in metadata and then using that auth token in the header of the rest API calls.

Welcome to the community, @Kapil_Chaudhary! Thanks for reaching out.

If I'm understanding your question correctly, I think the short answer is that this isn't currently supported. The most realistic workaround is probably to configure a polling query that hits the Retool API, but you would need to track changes to that metadata outside of the current_user object. Doing so would disable variable spoofing and, additionally, require an Enterprise plan to be truly effective.

Now that I think about it, though, are you referencing current_user.metadata.AUTH_TOKEN in the resource configuration or in the query itself? The former might work. :thinking: Can you give it a shot and let me know what you see?

Have you had a chance to review this, @Kapil_Chaudhary?