Skip to main content
1-Visitor
April 2, 2017
Question

Selecting a certain data from a table

  • April 2, 2017
  • 4 replies
  • 5946 views

Hello,

I would like to know how is it possible to select an info or data (cell) from a table?

for example if i would like to select Line = 65 ?

Thanks in advance

4 replies

5-Regular Member
April 3, 2017

Karim, you can use the existing code snippet for the Infotable i.e. Create query for an Infotable something like this

5-Regular Member
April 4, 2017

Hi Karim BADR​,

We can read it like below:

For particular cell: result.rows[1].Line;

For complete row: result.rows[1];

1-Visitor
August 16, 2018

I tried to get the value from one cell like in the example but its not working for me 

its shows me this error 'com.thingworx.dsl.engine.adapters.ThingworxInfoTableAdapter cannot be cast to com.thingworx.types.InfoTable'

kbadr1-VisitorAuthor
1-Visitor
April 4, 2017

Thanks but i get the data from csv file as below :

so how after that i connect the query of calling one line or a certain value with this script? or create other service to do this ?

5-Regular Member
April 5, 2017

Karim, you can use the code snippet from Ankit, see his thread above, in your same service or mine whatever way you are comfortable.

However, you probably would want to query some other Infotables, so you can create a new generic service to avoid writing same set of code again and again - which can take Infotable as input, instead of overloading this existing one.

Then you can simply input your infotable that you are creating above or any other infotable to run your query on it.

Hope this helps.

kbadr1-VisitorAuthor
1-Visitor
April 6, 2017

Hello,

Thanks alo for your help

as I am still discovering thingworx so i hope not asking much

how can I simply select a certain data or line from a table on the mashup? as i don't know how to use the script above

the infotable name is the name of the service or the name of datashape?

5-Regular Member
April 6, 2017

Hi Karim BADR​,

Infotable is DataType. So, It cannot be a Service or a datashape.

Generally output variable of a Service is named result. This variable result can be of type Infotable.

To get a field of a row; just open the 'selected row(s)' option of your service and corresponding field be give us the output of the selected row.