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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Element name machform

i_abidi
10-Marble

Element name machform

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

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3
i_abidi
10-Marble
(To:i_abidi)

 

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

slangley
23-Emerald II
(To:mneumann)

Hi @i_abidi.

 

If the solution provided by @mneumann helped you to solve your issue, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements


Top Tags