How to format Teachable price in Microsoft Excel to remove commas and other characters?
Hi there!
I need a bit of help please. I have some trouble formatting a price that is coming from Teachable. I am adding into an excel file different information and the price is coming like this: “4,26 Lei/lună”. What I want is a price formatted like this: “4.26” . Instead of comma, a dot and no other characters like Lei/lună. I also tried the AI tool for formatting but without success.
Any ideas on how I can achieve this, please?
Page 1 / 1
Hi @stefanasafti ,
You can use below Javascript code
var amount = inputData.amount.split(" ")"0]
output = {amount}
Below are the screnshot on how to implement it
Thanks @jayeshkumarbhatia
I am not quite sure where to place this. I need to make formatter step, i guess. But, can you please give me more details of the steps?
You have to use Code by Zapier and not formatter by Zapier
thanks @jayeshkumarbhatia
Do it type the 4,26 Lei/lună in the Input Data? in your screenshot it shows Output.
I get this result
Hi @stefanasafti ,
The output value is just an example. In your Zap the input value will be price from Teachable.
@jayeshkumarbhatia something like this?
Yes @stefanasafti
Something is still not working. Here’s my zap:
The test seems to run fine, BUT…the question is, how to I test everything so I see the final input? If i test the last step which is Google Sheets, the price output is formatted the same (4,26 Lei/lună).
Can you share screenshot of how did you configure Google Sheet Action?
@jayeshkumarbhatia sure, here it is:
I just mapped all the fields that is find useful. The price field Pret comes from Teachable (Coupon - Formatted Price: 4,26 Lei/lună)
how if i think about it maybe it’s the wrong field. Probably Final Price should be the one to use. But still need formatting from 426 to 4.26
In Google Sheet Action, the price value will come from Code by Zapier and not Teachable
@jayeshkumarbhatia thanks for the answer. It’s working, but is there a way to add a dot instead of a comma as shown below?
Hi @stefanasafti!
Hope you don’t mind me hopping in to lend a hand with this. To replace the comma with a dot instead you could add amount = amount.replace(",", "."); in between the existing lines of code in your Code by Zapier action. The updated code should then look like this:
Then in the Create Spreadsheet Row action, you’d select the value that is output by the Code by Zapier action, instead of taking the value from the Teachable trigger. For example:
Can you give that a try and let us know if that gets it working as hoped?
@SamB per-fec-tion! thank you so much!
@jayeshkumarbhatia thanks buddy!
You are most welcome, @stefanasafti! I’m so pleased that did the trick!
Seems like you’ve got it all sorted now, but do let us know if there’s anything else we can assist on. Always happy to help!