- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 03:02 AM
Hello Team,
Am able to see the response body but I need to fetch particular data from that and should update the field.
Please let me know further on this.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 04:16 AM
Better is to go with JSON.
Alternatively you can use below in background for a check.
var obj='{"data":{\"productId\":10868022,\"productName\":\"Locker 100 - Valid\",\"isMobile\":false,\"modifiedDate\":null,\"modifiedBy\":null,\"inactiveReason\":null,\"id\":117974,\"clientId\":1511,\"clientName\":\"\",\"locationId\":2623,\"locationName\":\", \",\"machineUserId\":1659531581,\"machineAccess\":\"0015984\",\"isActive\":true,\"clientTicketNumber\":\"SCTASK0015984\",\"createdDate\":\"2023-11-03T10:15:56.637\",\"createdBy\":\"srinidhi.munji\"}}';
var getproductid=obj.split('productId\"')[1];
var gegproductid2=getproductid.split(',\"productName\"')[0]
gs.print(gegproductid2);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 04:49 AM
@srinidhi You can try the following.
var responseString="{\"data\":{\"productId\":10868022,\"productName\":\"Locker 100 - Valid\",\"isMobile\":false,\"modifiedDate\":null,\"modifiedBy\":null,\"inactiveReason\":null,\"id\":117974,\"clientId\":1511,\"clientName\":\"\",\"locationId\":2623,\"locationName\":\", \",\"machineUserId\":1659531581,\"machineAccess\":\"0015984\",\"isActive\":true,\"clientTicketNumber\":\"SCTASK0015984\",\"createdDate\":\"2023-11-03T10:15:56.637\",\"createdBy\":\"srinidhi.munji\"}}";
var responseObj= JSON.parse(responseString);
var product_id = responseObj.data.productId;
gs.info(product_id);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 03:05 AM
Hi,
Can you share the response body and what is to be fetched once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 03:18 AM
Hello @Jaspal Singh ,
Thanks for the reply. Please find the response body below.
"{\"data\":{\"productId\":10868022,\"productName\":\"Locker 100 - Valid\",\"isMobile\":false,\"modifiedDate\":null,\"modifiedBy\":null,\"inactiveReason\":null,\"id\":117974,\"clientId\":1511,\"clientName\":\"\",\"locationId\":2623,\"locationName\":\", \",\"machineUserId\":1659531581,\"machineAccess\":\"0015984\",\"isActive\":true,\"clientTicketNumber\":\"SCTASK0015984\",\"createdDate\":\"2023-11-03T10:15:56.637\",\"createdBy\":\"srinidhi.munji\"}}"
I need get the Product id from the response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 04:16 AM
Better is to go with JSON.
Alternatively you can use below in background for a check.
var obj='{"data":{\"productId\":10868022,\"productName\":\"Locker 100 - Valid\",\"isMobile\":false,\"modifiedDate\":null,\"modifiedBy\":null,\"inactiveReason\":null,\"id\":117974,\"clientId\":1511,\"clientName\":\"\",\"locationId\":2623,\"locationName\":\", \",\"machineUserId\":1659531581,\"machineAccess\":\"0015984\",\"isActive\":true,\"clientTicketNumber\":\"SCTASK0015984\",\"createdDate\":\"2023-11-03T10:15:56.637\",\"createdBy\":\"srinidhi.munji\"}}';
var getproductid=obj.split('productId\"')[1];
var gegproductid2=getproductid.split(',\"productName\"')[0]
gs.print(gegproductid2);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 04:45 AM
@Jaspal Singh Checking on it.
Thanks