Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
hey devs ! Merry Christmas :) I m trying to query a machform using a thingworx mysql service starting :
SELECT date_created as Date, Line.`option` as Ligne, concat(element_41,' ', element_46) as Auditeurs, z1.`option` as Score_Z1 , z2.`option` as Score_Z2, z3.`option` as Score_Z3, (z1.`option` + z2.`option` + z3.`option` ) / 3 as Score_Global , d.`option` as Nombre_Defauts, element_12 as Top_Action
FROM ap_form_122320 F etc. The service works perfectly and returns the requested data except for Auditeurs instead of returning the content/ text of the drop list selection , it returns just the element number. Does anyone knows how to get it to return the text & not the element number ? thx
Solved! Go to Solution.
I'm not sure if I understand this correctly...
To me it seems the element41 + element46 are some kind of input parameters for the service.
These are taken from a dropdown list which is displaying text.
With this text a certain value is associated.
The query should use this value instead of the text.
Under that assumption, you can check the List / Dropdown Widget.
There should be a Display and a Value Field.
If assigning a Data set to the List / Dropdown with multiple fields you can select which column in the InfoTable should be used for displaying the data in the Widget and which one is the value associated. When calling the MYSQL service you can then use the value as an input parameter, which will give you the number instead of the text.
Not sure if that makes sense...
Cheers,
Michael
I'm not sure if I understand this correctly...
To me it seems the element41 + element46 are some kind of input parameters for the service.
These are taken from a dropdown list which is displaying text.
With this text a certain value is associated.
The query should use this value instead of the text.
Under that assumption, you can check the List / Dropdown Widget.
There should be a Display and a Value Field.
If assigning a Data set to the List / Dropdown with multiple fields you can select which column in the InfoTable should be used for displaying the data in the Widget and which one is the value associated. When calling the MYSQL service you can then use the value as an input parameter, which will give you the number instead of the text.
Not sure if that makes sense...
Cheers,
Michael