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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

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

tguo
4-Participant

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

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

ACCEPTED SOLUTION

Accepted Solutions
ankigupta
12-Amethyst
(To:tguo)

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

View solution in original post

6 REPLIES 6
posipova
20-Turquoise
(To:tguo)

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.

tguo
4-Participant
(To:posipova)

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...

ankigupta
12-Amethyst
(To:tguo)

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

tguo
4-Participant
(To:ankigupta)

Thank you!

ankigupta
12-Amethyst
(To:tguo)

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?

ppradhan-2
12-Amethyst
(To:tguo)

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

Announcements


Top Tags