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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Coding Examples of Setting / Getting values

MM_9665428
4-Participant

Coding Examples of Setting / Getting values

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
jman87
14-Alexandrite
(To:MM_9665428)

@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

View solution in original post

2 REPLIES 2
jman87
14-Alexandrite
(To:MM_9665428)

@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

slangley
23-Emerald II
(To:MM_9665428)

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

Top Tags