Skip to main content
1-Visitor
October 29, 2020
Solved

Coding Examples of Setting / Getting values

  • October 29, 2020
  • 2 replies
  • 1402 views

 

Hi, hoping you're doing well

 

I'm pretty new with thingworks and some functionalities still confuses me...

 

I need develop an aplication that:

 

- select a date range (I didn't see a Calendar Widget) and pass it to a service to make a query and get the results from db

 

- from a service read data from db and fill a List

  - from the selection of the list execute a query to read data from db

 

- from a service read data from db and fill a Graph

 

Also I need to manipulate de data from the query (make some calculations) and show them in the mashup

 

If you can give a coding example (or several) i'll appreaciate it.....

 

Best Regards,

Marcos

Best answer by jman87

@MM_9665428 

Please refer below:

 

- select a date range (I didn't see a Calendar Widget) and pass it to a service to make a query and get the results from db

 

[comment] Date time Picker widget or Time Selector widget are related with date range.

Below I have selected the datetime as the input parameter value of my "InsertRecord" service in order to insert an entry to database (bind data time picker widget with input parameter "DateTimeField" > "IndertRecord" service). You may refer it to make a query and get the results from db (sure you need to create some *GetRecordBasedOnTime* service):

2020-10-29_17-10-53.jpg

- from a service read data from db and fill a List

  - from the selection of the list execute a query to read data from db

Refer my latest reply on https://community.ptc.com/t5/ThingWorx-Developers/store-the-SQL-result-in-a-Datatable-entity/m-p/695217/highlight/false#M48694 

 

Best Wishes!

Teresa

2 replies

jman8715-MoonstoneAnswer
15-Moonstone
October 29, 2020

@MM_9665428 

Please refer below:

 

- select a date range (I didn't see a Calendar Widget) and pass it to a service to make a query and get the results from db

 

[comment] Date time Picker widget or Time Selector widget are related with date range.

Below I have selected the datetime as the input parameter value of my "InsertRecord" service in order to insert an entry to database (bind data time picker widget with input parameter "DateTimeField" > "IndertRecord" service). You may refer it to make a query and get the results from db (sure you need to create some *GetRecordBasedOnTime* service):

2020-10-29_17-10-53.jpg

- from a service read data from db and fill a List

  - from the selection of the list execute a query to read data from db

Refer my latest reply on https://community.ptc.com/t5/ThingWorx-Developers/store-the-SQL-result-in-a-Datatable-entity/m-p/695217/highlight/false#M48694 

 

Best Wishes!

Teresa

Community Manager
November 9, 2020

Hi @MM_9665428.

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon