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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Apply Regular Expression on Infotable row

ptc-6291975
1-Newbie

Apply Regular Expression on Infotable row

Hi,


I am facing some issue working with data in Infotable as below:

1. I have a service that query data from a MYSQL server using SELECT DateTime statement (only return the DateTime column data).

2. The result is returned properly with one of the column representing DateTime with format MM/DD/YYYY HH:mm

3.  Now I want to populate through every single row of data, and use regular expression to retrieve the DD info from every row.


Problem faced:

It seems that the getrow(rowindex) is returning format like this: {DateTime=com.thingworx.types.primitives.StringPrimitive@16b2f63}.

I am not sure how to parse this type of data from Infotable using the regular expression. How do I convert the StringPrimitive type to normal String type in order for me to parse the data in Infotable accordingly?


Please kindly advise. Thanks in advance.




1 REPLY 1

I think you want to do something like this where rawdata is your infotable name

var rawdata = Things["DatabaseName"].GetDateTimeData


for each (var row in rawdata.rows) {
 var DateTimeValue = row.DateTime;
 var Day = dateFormat(DateTimeValue, "dd");

}

Top Tags