CA
wise-white

Apify Actor Input param is not working.

Now I'm building actor in apify. But I have one problem for input value of actor. I can't get input value in code. Following is my code. const startUrls = Actor.getInput(); It return NULL value. Please let me know what is problem. { "title": "CheerioCrawler Template", "type": "object", "schemaVersion": 1, "properties": { "startUrls": { "title": "Start URLs", "type": "array", "description": "URLs to start with.", "editor": "requestListSources", "prefill": [ { "url": "https://apify.com" } ] } } } This is input schema.
5 Replies
Pepa J
Pepa J3y ago
Hello @Harry Is your code after actor being initialized?
await Actor.init();
// here
await Actor.exit();
await Actor.init();
// here
await Actor.exit();
wise-white
wise-whiteOP3y ago
Of course, I tried between init and exit.
MEE6
MEE63y ago
@Harry just advanced to level 1! Thanks for your contributions! 🎉
HonzaS
HonzaS3y ago
const startUrls = Actor.getInput(); this is wrong, you are missing await
wise-white
wise-whiteOP3y ago
ah right. you are right. Thanks for your help. 👍

Did you find this page helpful?