Hello,
I have just attended the Dev meet up group and one of their suggestions for JSON files was to use it as a config file.
My bot is creating zendesk tickets and the dev environment has different custom field values than the prod environment. So the JSON config would be a great way of storing this data.
I’m currently doing this with XML, reading it every single time and setting all variables (its a lot of them).
My though was that the new JSON package could safe some time since it allows the JSON to dictionary action. I would only reference the dictionary with the key when needed and not having to create and fill a bunch of variables prior.
So here is the JSON sample:
{
"Environment": "Dev",
"Zendesk":
{
"URL-Prod": "Prod Environment",
"URL-Dev": "Dev Environment",
"custom_fields":
{
"market-Prod": "5678",
"market-Dev": "1234"
}
}
}
In AA I start a JSON session to the control room file. I then convert the JSON to dictionary and select multiple variables. One will be a string called environment and one will be a dictionary call zendesk.
If I now create a message box and display $Environment$ I will receive ‘Dev’. I can also get the items from the dictionary $Zendesk{“URL-Dev”}$
My Problem:
How do I get the dictionary to be dynamic based on the environment variable?
Something like this $Zendesk{“URL-”$Environment$}$
This would allow me to only switch the Environment in the file and I would not have to declare all variables since I would use a dictionary.