update an env variable from a global action

Is it possible to update an env variable from within a global action?
3 Replies
Chocci_Milk
Chocci_Milk8mo ago
Hello, You can't update an environment variable from an action. That wouldn't be a safe practice either. Whats your use case here?
Jay
JayOP8mo ago
We have a access token that needs to get refreshed every 8 hours, and its global across all models. (for ex in shopify app context, its global to all shops)
Chocci_Milk
Chocci_Milk8mo ago
A workaround that comes to mind: - Make a custom model named nonStatic or something to identify the rotating values - Add fields that pertain to the token (expiry, value, etc) - Have a global action that rotates the token (only change that one record) - From the backend you can always fetch that record at its current state There might be some better way to do this but this is a quick fix

Did you find this page helpful?