cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

want to set of session variable one parameter string value to null

PK_10315615
3-Visitor

want to set of session variable one parameter string value to null

Tring to set value of bsl as null but other properties values like temperature or owner should remain same in session.

 

this is the session input:

 

{"containerListFilters":{"location":[],"temperature":[{"array": [{"list_id": 1,"list_name": "RT"}]}],"owner":[], "bsl":[{"array": [{"list_id": 1,"list_name": "BSL 1"}]}]}}

 

output should be:

{"containerListFilters":{"location":[],"temperature":[{"array": [{"list_id": 1,"list_name": "RT"}]}],"owner":[], "bsl":[{"array": []}}

 

how can write the code for this?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TonyZhang
13-Aquamarine
(To:PK_10315615)

Hi @PK_10315615 

Don't know how setting a JSON element is related to session parameter but you can create a custom JS service in ThingWorx with a JSON input say called "input" and output as JSON

 

input.containerListFilters.bsl[0].array = [];
result = input;

 

View solution in original post

1 REPLY 1
TonyZhang
13-Aquamarine
(To:PK_10315615)

Hi @PK_10315615 

Don't know how setting a JSON element is related to session parameter but you can create a custom JS service in ThingWorx with a JSON input say called "input" and output as JSON

 

input.containerListFilters.bsl[0].array = [];
result = input;

 

Top Tags