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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Add properties of a thing to infotable useing string

GustavHerrst
4-Participant

Add properties of a thing to infotable useing string

Hello, i'am trying to add the value of a property to the Value column of a infotable located in the same thing as the properties i want to use. I have the name of every property in string format and since there are around 200 of them i wanted to use this to add them. example:

myArr = [{Name: 'Tag1', Message: 'Hello', Type: 'BOOLEAN'},

{Name: 'Tag2', Message: 'Sweet', Type: 'BOOLEAN'}]

 

me.myInfo.AddRow( 

     {

       Name: myArr[0].Name

       Message: myArr[0].Message

       Status: me.myArr[0].Name //This part dont work. I Have a property with that exact name and i want the status for that property

     }

 

how can i reffrence the tag with the string i have? Or another smarter way to refrence it? In my program im planning to use a for loop to go over every tag one at the time.Thingworx.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

GH_10737740_0-1696228181741.png

Ended up finding this justt after i posted and it seems to work fine... Thanks anyhow

View solution in original post

1 REPLY 1

GH_10737740_0-1696228181741.png

Ended up finding this justt after i posted and it seems to work fine... Thanks anyhow

Top Tags