Is there a way to apply a currency format to merge fields?

  • 1
  • Question
  • Updated 3 years ago
Example, I have a Template with HTML that is pulling this field in using the global merge syntax: {{$Model.Application.data.0.Total_Budget__c}}

The value is appearing without the currency symbol and is missing commas in case of thousands, etc. 

Thanks for the help!
Photo of Jason Thurgood

Jason Thurgood

  • 654 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Anna Wiersema

Anna Wiersema

  • 10,890 Points 10k badge 2x thumb
Tell me some more about the Total budget field - is it a currency type field to begin with?  Have you tried using triple braces (although maybe that would remove commas etc).
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Global merges ( using the format {{$Model.ModelName.data.0.FieldName}}  currently do not pass the metadata necessary to correctly format the field.  You will need to make your template attach direclty to a model and read data directly.  
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Jason,

Are you in a multi-currency Org?  If not, you can hardcode the Currency Code.  Otherwise, you can use a custom field renderer and leverage the CurrencyIsoCode field for proper formatting.

Just a few other ideas for you to consider.

Regards,
Irvin