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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

UpdatePropertyValues throws : An Invalid Property Value Was Sent To Thing Property: [null]

ahawaldar
1-Newbie

UpdatePropertyValues throws : An Invalid Property Value Was Sent To Thing Property: [null]

Hello Team,

I have few properties for a thing . Lets say properties are x,y and z. A custom service is written which will set the values for x, y and z in java server side extension. What I have done is. I have created a datashape which has same property definition as that of x, y and z. From this datashape created an infotable as below

DataShape freqComponentTimeSeriesDataShape = (DataShape) EntityUtilities.findEntity("FreqComponentTimeSeriesDataShape", ThingworxRelationshipTypes.DataShape);

InfoTable valueStreamInfoTable = freqComponentTimeSeriesDataShape.CreateValues();

Next , I have added values to the infotable. When I invoke the service UpdatePropertyValues  on the thing in server side extension code it throws the error as  An Invalid Property Value Was Sent To Thing  Property: [null].

The code is as below

Thing rollingStockThing = (Thing) EntityUtilities.findEntity("RollingStockThing", ThingworxRelationshipTypes.Thing);

rollingStockThing.UpdatePropertyValues(valueStreamInfoTable);

Thanks,

Azim

1 ACCEPTED SOLUTION

Accepted Solutions
vr-6
4-Participant
(To:ahawaldar)

Hi,

var newEntry = new Object();

newEntry.time = new Date(T_UX*1000); // Time Stamp

newEntry.quality = undefined;

newEntry.name = "CirculationPumpPressure"; //Property 1

newEntry.value = CirculationPumpPressure; // Property 1 value

info1.AddRow(newEntry);//Add roe to infotable

newEntry.name = "DAQStatus";//Property 2

newEntry.value = DAQPowerStatus;// Property 2 value

info1.AddRow(newEntry);//Add row to infotable

Above code will update all property with same timestamp.

You need to initially add timestamp to your infotable and add other property & values.

Finally pass infotable to Updateproperty service

View solution in original post

5 REPLIES 5
vr-6
4-Participant
(To:ahawaldar)

Hi,

To use UpdatePropertyValues, infotable should have 4 field ( name, value,quality, timestamp).

name - Property name

value - Property value

quality - can be undefined

timestamp - Time

Add all your Property and Property values to infotable and pass it to "UpdatePropertyValues" service.

ahawaldar
1-Newbie
(To:vr-6)

Hi,

I guess this will update each property per timestamp. Then all the other properties will have different timestamp. My requirement is for the same timestamp update all properties i.e all properties should have same timestamp for each row.

vr-6
4-Participant
(To:ahawaldar)

Hi,

var newEntry = new Object();

newEntry.time = new Date(T_UX*1000); // Time Stamp

newEntry.quality = undefined;

newEntry.name = "CirculationPumpPressure"; //Property 1

newEntry.value = CirculationPumpPressure; // Property 1 value

info1.AddRow(newEntry);//Add roe to infotable

newEntry.name = "DAQStatus";//Property 2

newEntry.value = DAQPowerStatus;// Property 2 value

info1.AddRow(newEntry);//Add row to infotable

Above code will update all property with same timestamp.

You need to initially add timestamp to your infotable and add other property & values.

Finally pass infotable to Updateproperty service

ahawaldar
1-Newbie
(To:vr-6)

Thanks Velkumar R

qngo
5-Regular Member
(To:ahawaldar)
Top Tags