Default inputs for run screen vs. API

Is there a way to set a default input JSON or default field value in the actor IF the actor is being run from within Apify run screen vs. API?
5 Replies
Hall
Hall3w ago
Someone will reply to you shortly. In the meantime, this might help:
Louis Deconinck
Not really, but you can check in your code if the run was triggered through API or Apify UI with the origin field: https://docs.apify.com/platform/actors/running/runs-and-builds?fpr=7p4wu#origin
Runs and builds | Platform | Apify Documentation
Learn about Actor builds and runs, their lifecycle, sharing, and data retention policy.
Anthony (dev)
Anthony (dev)OP3w ago
Thanks, maybe that'll work, would just have to change my default input to "auto" or something and have the Actor select it accordingly. Basically for those hitting it via API, they just want a full JSON payload of extracted data, Markdown, HTML. But for those in the web interface, they just want the table data populated first and foremost. The default at the moment of the field that controls this behaviour is JSON, so a lot try it, don't read it, and assume it didn't work.
Louis Deconinck
Yes, that seems like a good approach to me if you still want to give people the option to override the default.
Anthony (dev)
Anthony (dev)OP3w ago
Thanks again!

Did you find this page helpful?