Get currency from field with Form Builder

Hi Everyone!

I have a view with two fields of type money, then I need to make a dependent field that this one will be visible when the currency type of some this money type fields be USD.
How could I will made it with the formula constructor?

Thanks!

  • In general, for currencies, you should be able to use the following in the formula to return true if the related currency is USD, false if not.

    ifElse(equal(related($currencies,"iso4217"),"USD"),true,false)

    But I'm not sure that will work if you are looking for the default currency, since -99 is not really an id in the Currencies table.

    I suppose you could go about it a very roundabout way by checking that the currency is NOT any of the others you have defined in your Currencies table, and thus by exclusion, determine that it must be the default currency?

    For example:

    ifElse(equal(related($currencies,"iso4217"),"GBP"),<this is not USD return false>,<check the next one>)

    so if you have GBP and EUR in your currencies table you nest the checks:

    ifElse(equal(related($currencies,"iso4217"),"GBP"),false,ifElse(equal(related($currencies,"iso4217"),"EUR"),false,<it's USD>))

    Perhaps others have a better solution...

    FrancescaS

  • Also note that there is only ONE currency_id per module, so your two money fields will be the same currency in any one record.