Help

Can I access the symbol of a currency field?

Topic Labels: Scripting extentions
1316 4
cancel
Showing results for 
Search instead for 
Did you mean: 

I’ve been trying to access the symbol of a currency field. However with no luck as my output returns undefined.
I’ve been looking in the API reference and it seems the the field has who properties, symbol and precision. But how do I access the symbol value?

const table = base.getTable('report');
let price = table.getField('price').symbol
output.inspect(price)
output.inspect(price[symbol])
4 Replies 4

For any fields that have configuration options that are made available through the API, you access them through the options object, which is an attribute of the field:

CleanShot 2020-03-26 at 08.32.58

@Jeremy_Oglesby do you know if it is also possible to update the symbol with a script?

@Jeremy_Oglesby Its alright I figured it out already. doing the following helped:

await field.updateOptionsAsync(
   {
      precision: 2,
      symbol: "£",
   }
)