Help

Re: Email automation returning currency format different from the grid

903 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Camanzi
4 - Data Explorer
4 - Data Explorer

Hello community,
Please, can someone explain (or where can I find the information) on how to add 2 decimal places after the comma in the currency format in email automation?
Thanks

5 Replies 5
Camanzi
4 - Data Explorer
4 - Data Explorer

In the attached file you can see another example of what has happened to us in the values in the automated emails. Please, We need help from someone qualified to answer!!! Or, do we only have Administrators who delete posts that criticize Bugs like these on Airtable?

I haven't run into this problem myself, but it looks like this solution could work for you:

https://community.airtable.com/t5/automations/currency-format-in-email/m-p/41204#M1116

The solution is to add an extra step (a script) to the automation to format the currency value before it goes into your email.

Hi @Andy_Lin1 @ thanks for this awesome code and example base!

But unfortunately the Script does not work with numbers below 1,000.00.

We are in a difficult situation here. Could you please tell us how we could correct this point or suggest other Codes that solve this?

Thank you very much for your willingness to help.

Is this the script you're using?
https://community.airtable.com/t5/automations/currency-format-in-email/m-p/41210#M1122

The regular expression in the script should work for numbers below 1000. Can you show what's happening with those numbers and how they should look instead?

Lu
6 - Interface Innovator
6 - Interface Innovator

@Andy_Lin1  is correct, you need to add a Run script automation step before the email step. You need to pass each number you want to as an Input variable. Use something like this in the script:

 

const formatter = new Intl.NumberFormat('pt-BR', {
    style: 'currency',
    currency: 'BRL'
});
Object.entries(input.config()).forEach(([k, v]) => {
    output.set(k, formatter.format(v));
});

 

Then use that script step's output variables in your email content (instead of the original record's values).