How to tackle "-" character in pm.variables.set?

With API response like below, how to tackle the “-” character in pm.variables.set? Thanks.

{
“resource-usage”: {
“oper”: {
“l4-session-count-min”: 4194304,
“l4-session-count-max”: 33554432,
“l4-session-count-default”: 8388608,
}
}

“-” causing issue and doesn’t work below
var jsonData = pm.response.json();
pm.environment.set(“l4-session-count”, json.Data.resource-usage.oper.l4-session-count-min);

You can access javascript properties by using square brackets

json.Data['resource-usage'].oper.['l4-session-count-min']
2 Likes

It works. Thanks Allen.

jsonData[‘resource-usage’][‘oper’][‘l4-session-count-min’]