Skip to main content
10-Marble
Jun 22, 2023 5:41 AM UTC
Solved

How to return only a certain value from infotable

I tried to use the code from https://community.ptc.com/t5/IoT-Tips/Analytics-Prediction-Methods-Mashup/ta-p/817989#M30973, but there is an error for the last line of predict strength script. Then I change the result to only predictivescorse, and got this result. How do I get only the expected outcome and put it into my properties?

AF_10333884_0-1687409823354.png

 

thanks

 

 

VelkumarAnswer
19-Tanzanite
Jun 22, 2023 7:44 AM UTC

Hi @A_10333884 

 

Please find the below snippet. 

var expectedOutCome = resultInfoTable.rows[0].ExpectedOutCome; // Get Outcome value from InfoTable
me.propertyExpectedOutCome = expectedOutCome // Update Properties

 

/VR

3 replies

Velkumar19-TanzaniteAnswer
19-Tanzanite
Jun 22, 2023 7:44 AM UTC

Hi @A_10333884 

 

Please find the below snippet. 

var expectedOutCome = resultInfoTable.rows[0].ExpectedOutCome; // Get Outcome value from InfoTable
me.propertyExpectedOutCome = expectedOutCome // Update Properties

 

/VR

Translate
10-Marble
Jun 23, 2023 12:47 AM UTC

Hi,

 

I tried to do what you just said, but the result become undefined when it should be string/number

AF_10333884_0-1687481227558.png

 

Translate
19-Tanzanite
Jun 23, 2023 4:47 AM UTC

Hi @A_10333884 

 

There is a typo in your script line number 32. It should be "ExpectedOutcome"

 

/VR

Translate