WindmillWWindmill
Powered by
John MikeJ
Windmill•2y ago•
3 replies
John Mike

[Solved] Frontend script call backend script, do UI stuff and download the returned data as file

Hello everyone, new windmill user here. Trying to grasp how windmill works and building a small internal app at the same time.
I'm trying to wrap my head how I can have my own frontend script run a backend script, get the result, do some UI stuff based on the result and download it on the user's computer (through the normal browser's download dialog).

I see that a backend inline script "just works" without any additional action from me. But what about when I need to run that backend script from a frontend script and do something with the results (including downloading it)?

Is a Transformer the right solution? Or maybe the web Fetch API (run a fetch request from the frontend script to my windmill API, trigger the backend script and get the result).
For now, I have stored my backend script on the workspace scripts and linked the button with it. Then added a Transformer with the usual javascript code for downloading files (found in the docs and windmill ai).

Thanks!
WindmillJoin
3,362Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Download file as script result (windmill UI)
ni_kaNni_ka / help
11mo ago
Windmill Apps: frontend script helpers : recompute a backend script and wait for new job id
DanDDan / help
9mo ago
Download csv file from python script + app
ExodeusEExodeus / help
3y ago
[Solved] DataFrame in Script and Flow Showing Incorrect Headers
brian_gtbBbrian_gtb / help
2y ago