data type of display value of a column(not internal type) using rest api

kanikag
Tera Contributor

I want to retrieve the data type of column, not internal type. I know how to get internal type using sys_dictionary, I am looking for data type of column for example

state column in task table has internal type integer but display value is string(Open, closed)

10 REPLIES 10

Would this get what you want?

var typeval = g_form.getDisplayValue(variableName);
g_form.addInfoMessage(typeof typeval);

I am looking for using RestAPI (table api), do you know parallel of this in rest api

Amit Verma
Kilo Patron
Kilo Patron

Hi @kanikag 

 

In the REST API explorer, you have a query parameter "sysparm_display_value" which defaults to false. Whenever it is false, the REST API response will always have the internal or the actual values being returned. If you make it true, you will get the display value. Refer below snips for better understanding -

 

1. When sysparm_display_value is false or not defined (default false) :

AmitVerma_0-1731983296884.png

 

AmitVerma_3-1731983375072.png

 

2. When sysparm_display_value is true :

 

AmitVerma_4-1731983416537.png

 

AmitVerma_5-1731983434282.png

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Hi Amit, I am looking for the data type of the display value here, for state I am trying to fetch string data type

@kanikag 

 

If you want to get the data type, you need to query the sys_dictionary table with the right filter condition. Refer below screenshots where I am trying to get the data type of state field.

 

AmitVerma_0-1732164699625.png

 

AmitVerma_1-1732164748480.png

 

AmitVerma_2-1732164760973.png

 


Please mark this response as correct and helpful if it assisted you with your question.