TECHIES WORLD

For Techs.... Techniques.... Technologies....

AWSBashCpanelLinux

How to use variables in JSON element

How to use variables in JSON
Usually the JSON elements are placed inside double quotes and we can add variables also inside that without any issues.
But if the JSON contains another array of JSON, the variable assignment will not work.
In-order to resolve this issue, the varaible need to put it inside single quotes encloded by a set of double quotes.

For eg:

{"Value":"'"${VAR}"'"}

Now the variable expansion will work properly.

That's all…