Skip to main content

Can I access the symbol of a currency field?

  • March 26, 2020
  • 4 replies
  • 13 views

Kim_Trager1
Forum|alt.badge.img+23

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

Forum|alt.badge.img+18
  • Inspiring
  • 1691 replies
  • March 26, 2020

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:


Kim_Trager1
Forum|alt.badge.img+23
  • Author
  • Brainy
  • 168 replies
  • March 27, 2020

Thank you @Jeremy_Oglesby.


Forum|alt.badge.img+3
  • Participating Frequently
  • 7 replies
  • February 17, 2023

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:


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


Forum|alt.badge.img+3
  • Participating Frequently
  • 7 replies
  • February 17, 2023

@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: "£", } )