Refresh of Metadata

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

Use Case: Implement CRUD operations with user_attribute from the Retool API to create "custom filters" for users, allowing them to select columns to display. Each user should have their own custom column settings saved in the metadata.

Steps:

  1. Utilize the Retool API to update user attributes.
  2. After updating, if I want to read the user attribute using {{ current_user.metadata.taskColumns }}, the metadata does not refresh until I reload the page.

Details:

  • Is there a way to refresh the metadata with a script like metadata.refresh() or another method to ensure the updated attributes are immediately available?

Thanks a lot for your help!

Hi @JuanPablo,

Did you manage to find a workaround for this? I don't think there is a method to refresh metadata, however you could:

  • Save this in local storage rather than user_attributes, so that it is immediately available and it persists across sessions, OR
  • Set up a variable that it is used for in-session updates and set up your logic so that if it is null it uses the user_attribute value.

Hope this helps!

1 Like