Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

System Property key-value not working

UTSAV KUMAR JAI
Tera Contributor

Hello Everyone,

I am having a code as---

    var var1 = "One";
    var mappingJson = gs.getProperty('test.qwerty');
    var mapping = JSON.parse(mappingJson);
    if (var1 == mapping["1"]) {
        gs.addInfoMessage("System Property is working");
    }
    else{
        gs.addInfoMessage("System property is not working");
    }
 
And, in system property side,

Type--String
Value--{"1":"One","one"}


Currently, it is not working, any inputs??

Warm Regards
Utsav
5 REPLIES 5

Raghav Sharma24
Giga Patron

Your JSON is invalid, it should be something like below:

 

{
"1":"One",
”2”:”two”

}