How Can I use key value pair in system property?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2019 04:18 AM
Hi want to define key and value pair(Dictionary)in system property and call the system property in the script. Depending on the key I provided in the script the property should return the value.
Any help will be appreciated.
Regards,
Amitra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2019 05:51 AM
Amitra,
A system property is essentially a key value pair itself, can you explain your use case a bit better? I suppose if you only wanted a single system property to reference and then hold multiple sub-key/value pairs you could store a JSON object as a string and reference its key/values as needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2019 06:31 AM
I know json is a way.. But I am not willing to implement JSON. Can you please tell me what is the functionality of choice field in property?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2019 08:40 AM
as an example of what @johnstettin mention.
Value of sys_property
{
"keyName1": "String Value",
"keyName2": 0,
"keyName3": ["string1", "string2", ...],
"keyName4:" {
"innerKeyName1": "Inner Key Value",
"innerKeyName2": 4
}
}
and use it as such
var config = global.JSON.parse(propertyName);
gs.log(config.keyName1); //String value