How can I set the state of an app inside a fetch script?
I'm trying to use a fetch script, and then with the result store it in the state. How can I store it and then use it later?
6 Replies
In a REST script you cannot import libraries, so ideally you'd use a flow where there's your current fetch script and another step where you save it to state. The state is then tied to this specific flow path.
ah ok thanks
Is there a way to set a state of the app in use? I'd like to do an API call that gets a token, or receives the error from it, and then make it available to the app for future use.
I see https://www.windmill.dev/docs/apps/app-runnable-panel#state but that does not seem to work inside a flow
Runnable Editor | Windmill
The strength of Windmill's app editor is the ability to connect everything together:
Since those are front-end scripts, and not flows
If you mean in a App, you have to do a background runnable and then another background runnable that runs on the frontend to use that variable
In that frontend runnable, you can set the value to the App state
ah ok thanks
That did the trick, thanks for the help!