Best answer

How to format Teachable price in Microsoft Excel to remove commas and other characters?

  • 17 October 2023
  • 16 replies
  • 74 views

Userlevel 1
Badge

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?

icon

Best answer by SamB 18 October 2023, 12:02

View original

16 replies

Userlevel 6
Badge +6

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

 

Userlevel 1
Badge

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?

 

Userlevel 6
Badge +6

You have to use Code by Zapier and not formatter by Zapier

Userlevel 1
Badge

thanks @jayeshkumarbhatia 

Do it type the 4,26 Lei/lună in the Input Data? in your screenshot it shows Output.

I get this result

 

Userlevel 6
Badge +6

Hi @stefanasafti ,

 

The output value is just an example. In your Zap the input value will be price from Teachable. 

 

Userlevel 1
Badge

@jayeshkumarbhatia something like this?

 

Userlevel 6
Badge +6

Yes @stefanasafti 

Userlevel 1
Badge

Something is still not working. Here’s my zap:

I added the Code by Zapier before the data is being sent to Google Sheets

 

I added the price entry from Teachable

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ă). 

Userlevel 6
Badge +6

Can you share screenshot of how did you configure Google Sheet Action? 

Userlevel 1
Badge

@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ă)

Userlevel 1
Badge

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

 

Userlevel 6
Badge +6

In Google Sheet Action, the price value will come from Code by Zapier and not Teachable 

Userlevel 1
Badge

@jayeshkumarbhatia thanks for the answer. It’s working, but is there a way to add a dot instead of a comma as shown below?

 

Userlevel 7
Badge +11

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:  
1b138232c188f478d4310b629d5b8f37.png

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:
481380c0b82612ca714789921de92017.png

Can you give that a try and let us know if that gets it working as hoped? 

Userlevel 1
Badge

@SamB per-fec-tion! thank you so much!

@jayeshkumarbhatia thanks buddy!

Userlevel 7
Badge +11

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! 

Reply