Skip to main content
1-Visitor
May 27, 2017
Solved

How to use dropdown selection as input to get sql script output

  • May 27, 2017
  • 3 replies
  • 2669 views

I want to use dropdown selection as input to get sql script output.

1) I create a service using sql, the input is a string

WeChat Image_20170528072015.png

in SQL script, like this:

WeChat Image_20170528072040.png

2) In the mashup, there is a piechart to show the sql script result:

WeChat Image_20170528072132.png

3) The service is created successfully. The parameters are show in the service

WeChat Image_20170528072148.png

4) The dropdown menu service is like this, the 'name' is the input to the pie chart sql script

WeChat Image_20170528072237.png

I tried to drag the 'All Data' -> 'Name' or 'Selected Rows'->'Name' to match the input parameters 'BuildingName'. To get the pie chart input data. But failed.

How can I manage to do this? Thank you!

Sushant Pandey

Best answer by ankigupta

Issue Resolved. SelectedRowsChanged event of the Service feeding dropdown list widget was not bound to the Script Service feeding Pie-Chart.

3 replies

20-Turquoise
May 28, 2017

I'm not sure I quite understand your use case. You want to use an item from the drop-down list to serve as an input for your pie chart? You may try binding selected rows/Name to the Bindingbuilding parameter in your chart service.

tguo1-VisitorAuthor
1-Visitor
May 29, 2017

Hi Polina,

   Yes. You are right. I have binded the selected rows/Name to the Bindingbuilding parameter in the chart service. But not successful...

   I don't know why...

ankigupta5-Regular MemberAnswer
5-Regular Member
May 29, 2017

Issue Resolved. SelectedRowsChanged event of the Service feeding dropdown list widget was not bound to the Script Service feeding Pie-Chart.

5-Regular Member
May 29, 2017

Hi Tiantian Guo​,

Does this service work fine on testing from Composer?

Also, did you bind the selected value changed of the Service with the Sql Service to call it when the value changes?

1-Visitor
May 29, 2017

is the "Name" is input to the Pie chart? it seems String if thats the case and i am right then you will need to provide a infotable as a input to PieChart which contains The mainly 2 rows "Name" and respective % of that Name.

Go Through https://community.thingworx.com/message/49060#49060