Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi all,
I am writing a plugin which requires some user input, I am assigning the value of the input to a variable in my python code, like so:
key = get_recipe_config()['key']
However, when I run my recipe I get the error:
Line 23 the line I have shared above.
Here is the code from my plugins .json file where I define the key:
"params": [
{
"type": "SELECT",
"name": "key",
"label": "Authentication key",
"description": "Select the required service authentication key.",
"selectChoices": [
{ "value": "design/abd38200717c.json", "label": "design_717c"},
{ "value": "design/b3d42a4b33e5.json", "label": "design_33e5"},
{ "value": "automation/abd38200717c.json", "label": "automation_717c"},
{ "value": "automation/b3d42a4b33e5.json", "label": "automation_33e5"}
]
},
I have used this approach previously without any issues, and I believe my code is correct - what am I missing that is causing "key" not to be found?
Ben
You are quite right @Ignacio_Toledo - thankfully that was just a typo ๐
I eventually worked out what I was doing wrong here, I hadn't set a default value for the 'key' parameter - so it was in fact empty - duh!
Ben
Hi @ben_p .
I might be completely lost here, but shouldn't the code be in the recipe.json file instead of the plugin.json one?
Just a thought on what might be just a typo.
You are quite right @Ignacio_Toledo - thankfully that was just a typo ๐
I eventually worked out what I was doing wrong here, I hadn't set a default value for the 'key' parameter - so it was in fact empty - duh!
Ben
I thought about that too. On one hand I thought "most probably it was not pasted". On the other, if it was that obvious I thought @ben_p would solve by himself after some sleep! I've fight against gigantic bugs for hours, than would be shown to be just small typos when waking up the next day...
Haha glad to hear it is not just me that goes through this ๐