I am dealing with a JSON filter in which the value for firmwareversion needs to be replaced with a dynamic value. Here's how I've set it up:
//JSON filter
this.comX200FilterValue = '{ "deviceType": "ComX", "firmwareVersion": "3.5.15" }';
// This method retrieves the dynamic firmwareVersion value as 3.5.15
this.deviceService.getFirmwareversion(config.GlobalConstants.Default.comx200Name)
.then((fwArray: any) => {
var Com200FirmwareValue = (fwArray[config.GlobalConstants.Default.comx200Name]);
})
My goal is to replace the filter string (firmware version value : 3.5.15) with the value of Com200FirmwareValue, like so: "firmwareVersion": "Com200FirmwareValue".
Is there a way to achieve this? Any recommendations or suggestions would be greatly appreciated :)