Skip to main content
Best answer

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

  • October 17, 2023
  • 16 replies
  • 125 views

Forum|alt.badge.img

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?

Best answer by SamB

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? 

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

16 replies

jayeshkumarbhatia
Forum|alt.badge.img+7

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

 


Forum|alt.badge.img
  • Author
  • Beginner
  • October 17, 2023

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?

 


jayeshkumarbhatia
Forum|alt.badge.img+7

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


Forum|alt.badge.img
  • Author
  • Beginner
  • October 17, 2023

thanks @jayeshkumarbhatia 

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

I get this result

 


jayeshkumarbhatia
Forum|alt.badge.img+7

Hi @stefanasafti ,

 

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

 


Forum|alt.badge.img
  • Author
  • Beginner
  • October 17, 2023

@jayeshkumarbhatia something like this?

 


jayeshkumarbhatia
Forum|alt.badge.img+7

Yes @stefanasafti 


Forum|alt.badge.img
  • Author
  • Beginner
  • October 17, 2023

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


jayeshkumarbhatia
Forum|alt.badge.img+7

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


Forum|alt.badge.img
  • Author
  • Beginner
  • October 17, 2023

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


Forum|alt.badge.img
  • Author
  • Beginner
  • October 17, 2023

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

 


jayeshkumarbhatia
Forum|alt.badge.img+7

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


Forum|alt.badge.img
  • Author
  • Beginner
  • October 17, 2023

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

 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • Answer
  • October 18, 2023

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? 


Forum|alt.badge.img
  • Author
  • Beginner
  • October 19, 2023

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

@jayeshkumarbhatia thanks buddy!


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • October 20, 2023

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!