unable to fetch data table entries with a string primary key
I have a data table with a string primary key. however, i store GUID in it. I am not able to fetch the data table entries in a service that takes the primary key's value as a parameter. I have something like this:
In one service:-
var guid = generateGUID();
// log user request in DT
var values1 = Things["UserRequests"].CreateValues();
values1.Status = 0; // in progress
values1.RequestID = guid; //GUID [Primary Key]
values1.RetryCount = 0; //INTEGER
values1.LoggedTime = new Date(); //DATETIME
values1.VehicleID = vehicleID;
var params1 = {
sourceType: undefined,
values: values1,
location: undefined,
source: undefined,
tags: undefined
};
Things["UserRequests"].AddDataTableEntries(params1);
In another service that takes the request id:-
var values = Things["UserRequests"].CreateValues();
values.RequestID = RequestID; //STRING [Primary Key]
var params = {
maxItems: undefined /* NUMBER */,
values: values /* INFOTABLE*/,
query: undefined /* QUERY */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
};
// result: INFOTABLE
var result = Things["UserRequests"].QueryDataTableEntries(params);
result.length returns 0

