Currency Code not showing in Reference type Field for Service Catalog

Sayantan Dutta1
Tera Contributor

Hi Everyone,

 

We have one order guide through which the users order their suitable laptop/desktop. We are using a reference type variable to display the list of laptops and desktops.

Recently, we have received a requirement in which we have to display the price of these catalog items in the dropdown.

So I have used the below reference qualifier to include the price column to the reference variable.

 

ref_ac_columns=price,ref_auto_completer=AJAXTableCompleter,ref_ac_columns_search=true

 

But the problem I am facing is that the currency code is not getting displayed. Only the price numeric value is what I am getting.

SayantanDutta1_0-1707796658905.png

 

Kindly let me know how I can display the currency code beside the price value in this dropdown.

 

Regards,

Sayantan

4 REPLIES 4

Amit Verma
Kilo Patron
Kilo Patron

Hi @Sayantan Dutta1 

 

Are you using a custom table to populate the reference field ? I just tried simulating your requirement on cmdb_ci_server table. I think you need to add currency column as well to the attribute ref_ac_columns like

ref_ac_columns=price,currency

 

This should display the currency as well. Please refer below screenshots and make the configuration accordingly.

 

AmitVerma_1-1707802449920.png

 

AmitVerma_0-1707802358294.png

 

Thanks & Regards

Amit Verma


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

Sayantan Dutta1
Tera Contributor

Hi Amit,

 

I tried this solution but the currency did not populate in the dropdown.

In the Maintain item table, catalog item XML I noticed that the unlike cmdb_ci_server table, the currency value is coming from fx_currency table. So seems directly calling currency in the reference qualifier is not providing the result.

PFB the screenshot of the XML:

SayantanDutta1_0-1708055019686.png

 

Kindly have a look and let me know if there's a way to populate the Currency.

 

Regards,

Sayantan

 

Hi @Sayantan Dutta1 

 

Which table your field is referencing to ?

 

Thanks & Regards

Amit Verma


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

Hi Amit,

 

We are not referencing the price from any table. We are trying the fetch the price amount that is saved on each catalog item using the reference variable that we are using in the order guide.

 

I checked the XML of one of the catalog items and found that the price is only storing the numeric value and not the currency code. That seems the reason the currency code is not getting populated.

 

<price>37</price>

 

Kindly let me know if there is any solution so we can also display the currency code.

 

Regards,

Sayantan