WindmillWWindmill
Powered by
EggingtonE
Windmill•8mo ago•
2 replies
Eggington

Saving to App State from File Input.

I am trying to create a CSV previewer in the windmill app editor (more steps later that is just step 1)... and I'm thinking my process should be that when a file is uploaded to the "file input" component, a background runnable will update state.csvContent to the decoded csv string, and then my preview text box watches state.csvContent and updates appropriately. The issue i'm encountering is that I can't seem to get state to update.

In my background runnable, I have passed state as an input.
export async function main(csv_file: string, state: any) {
  const decodedBytes = Uint8Array.from(atob(csv_file), c => c.charCodeAt(0));
  const decoder = new TextDecoder("utf-8");
  const csvContent = decoder.decode(decodedBytes);
  console.log(csvContent)
  state.csvContent = csvContent
  console.log(state)
}
export async function main(csv_file: string, state: any) {
  const decodedBytes = Uint8Array.from(atob(csv_file), c => c.charCodeAt(0));
  const decoder = new TextDecoder("utf-8");
  const csvContent = decoder.decode(decodedBytes);
  console.log(csvContent)
  state.csvContent = csvContent
  console.log(state)
}

here in the background runnable, when logging state it looks good, but in the editor sidebar, it never shows any new values populating to state... and likewise my text box is not rendering anything from state.csvContent
WindmillJoin
3,388Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

We're live here https://discord.com/channels/930051556043276338/1278977038430240813

henri-c · 6d ago

rubenf

Infrastructure as code

rubenf · 4w ago

rubenf

As we're preparing for a new Windmill sandbox SDK, we took the opportunity **to open-source NSJAIL sandboxing** and make it available in CE and easier to set. In 1.634.0, just set nsjail to benefit from the tightest security and isolation per job. It's constraining so no need to use it unless you need but now you won't be restricted in security for CE if you need to.

rubenf · 4w ago

Similar Threads

File input component & component re-rendering in app
DaanDDaan / help
16mo ago
Clearing file input
d10sfanDd10sfan / help
2y ago
Set Windmill App State From Bash Script
Trevor SullivanTTrevor Sullivan / help
3y ago
App Component File input stuck when file size is larger than 10MB.
Leon s kennedyLLeon s kennedy / help
12mo ago