Unable to set Currency type on an Asset record via flow designer flow

chaithra10
Tera Contributor

chaithra10_0-1745393574284.png

I am working on a catalog flow which creates asset records automatically and sets the cost and currency type(like $, Euro etc), I am unable to set the currency type as this is not a separate field on an Asset record. And it is defaulting to $ each time. COuld someone help?

2 ACCEPTED SOLUTIONS

@chaithra10 

PFB.

1. Variable set with 2 variables.
-> Currency type - Ref field

-> Price - String field

 

Add below variable attribute to the currency type field. So that users can search with both the code and symbol.

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=code;symbol,ref_ac_columns_search=true,ref_ac_display_value=false

JSiva_0-1745406792947.png

Flow:

JSiva_1-1745407024710.png

JSiva_3-1745407194101.png

var price = fd_data._2__for_each.item.price_1; 

 

The "item" is missing in your script.

 

View solution in original post

@chaithra10 

I believe I informed the same to use the correct outcome and also shared a gif for the same.

You might have missed it

AnkurBawiskar_0-1745414800483.png

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

31 REPLIES 31

J Siva
Tera Sage

Hi @chaithra10 
Try to set that field using inline script.

PFB the community post with similar requirement.
https://www.servicenow.com/community/developer-forum/change-currency-code-of-a-field-via-script/m-p/...

 

Regards,
Siva

chaithra10
Tera Contributor

Thanks for the response. I do not want to convert any value. I simply want to pass the currency type from catalog variables to the asset record in hardware table.

@chaithra10 
Yeah.. It's just a sample. PFB the script to set the currency type. Do the same in your flow inline script.

JSiva_0-1745397342273.png

 

@chaithra10 
Catalog item with two variables.

1. Currency type - Reference variable - table: fx_currency.

2. Price - Single line text.

JSiva_0-1745398754306.pngJSiva_1-1745398775852.png

 

Flow:

JSiva_2-1745398840226.png

Output:

JSiva_3-1745398905082.png

JSiva_4-1745398927074.png

Regards,
Siva