Apify Discord Mirror

Updated 5 months ago

why select schema not working?

At a glance

The community member has an input schema with a "platform" field that has options for different search engines. They are trying to retrieve the selected search engine from the actor's input, but when they print the "engine" variable, it shows "None". A comment from another community member suggests that the issue may be due to an extra white space in the "platform" field name, which should be "platform" instead of "platform ".

Plain Text
"platform ": {
            "title": "Search engine",
            "type": "string",
            "description": "Select the search engine you want your websites from.",
            "editor": "select",
            "default": "Duckduckgo",
            "enum": ["ddg", "ggl", "serp"],
            "enumTitles": ["Duckduckgo", "Google", "Serpapi"]
            },

I have this in my actor's input schema. Then I get the content of this
Plain Text
 actor_input = await Actor.get_input() or {}
            raw_query = actor_input.get('query')
            query = raw_query.replace(" ", "+")
            numbers_of_results = actor_input.get('results')
            engine = actor_input.get('platform')

but when I print the engine's content, it says
None
R
1 comment
hey, it looks like you have an extra white space in the property name field: "platform " instead of "platform"
Add a reply
Sign up and join the conversation on Discord