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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Update a row value in infotable

Surekha
13-Aquamarine

Update a row value in infotable

Hi,

    I have data in the info table. I want to replace particular column values(Another service outcome). How can I update it?


var x = me.getData();//x is infotable
for each( var row in x.rows)
{
var y= me.ltime_conv({
ltime: row.LTIME /* LONG */,
lyear: row.DLYEAR /* LONG */});//Another service out come
x.DTIME = y;//Here I'm trying to replace DTIME column values
}

result =x;

 

Regards,

Surekha N.

ACCEPTED SOLUTION

Accepted Solutions

either in loop you do

row.DTIME = y;

or simply 

x.rows[0].DTIME = y; // loop out to infotables to update particular row with indexes

 

both ways values are getting updated

View solution in original post

3 REPLIES 3

I checked through infotable related services in Snippet, there's not update services available, so you can only delete the row you want to change and add a new one, and Sort it if needed.

 

Infotable property in Thing entities is not a good place to store data, and value might lost or changed for unknown reason at some time, so you may want to use Datatable or Stream to store these infotable data, and then you can use the related update services to change row value.

either in loop you do

row.DTIME = y;

or simply 

x.rows[0].DTIME = y; // loop out to infotables to update particular row with indexes

 

both ways values are getting updated

Surekha
13-Aquamarine
(To:rosharma)

Hi @rosharma ,

    Yeah, I have followed the same way. Now it is working.

Regards,

Surekha N.

Announcements


Top Tags