Skip to main content
6-Contributor
March 2, 2023
Solved

Finding data in json from an infotable.

  • March 2, 2023
  • 1 reply
  • 1650 views

Hello,

 

Can somebody help me to write a service in thingworx where infotable data value is checked if it is found in a json data.

 

Thanks.

 

Best answer by Sathishkumar_C
  • Iterate the infotable
  • Compare values with JSON from infotable
  • if found, get the required values
var info = [INFOTABLE];
for( var i = 0; i < info.length; i++){
 //Get the infotable row values
 //Search in JSON
 if(isFound == true){
 //Get the required value
 }
}

If possible share the sample dataset.

1 reply

17-Peridot
March 2, 2023

Can you please explain bit more about your use case?

6-Contributor
March 2, 2023

I have a json data which has multiple json arrays. I have an infotable which has data which can be compared to the json data. If at all i find the value in the json then i have to get certain key value pairs of that object. 

17-Peridot
March 2, 2023
  • Iterate the infotable
  • Compare values with JSON from infotable
  • if found, get the required values
var info = [INFOTABLE];
for( var i = 0; i < info.length; i++){
 //Get the infotable row values
 //Search in JSON
 if(isFound == true){
 //Get the required value
 }
}

If possible share the sample dataset.