What is your goal?
Hi everyone.
I’m new to Make and have very little experience with coding in general.
I am trying to extract a first name, last name and phone number from my google calendar title/summary to be used later to create a customer and invoice in QuickBooks online.
Through Google searches and AI assistance, I’ve discovered that I need to get the data into variables using this code:
split(trim(replace(map[Summary]; “#”; “”)); " ")[1]
This is supposed to remove the # sign from the beginning of the text string (which is the symbol I’m using it trigger the event), then split the first word and save it as a variable, I believe.
I’ve figured out that I need to use Make’s code to define split, trim, replace, etc. by typing a / in the variable value box, then typing “split” or trim, etc.
What is the problem?
The problem I’'m having is that I cant figure out how to type the action to extract the 1st word.
So when typing this code: split(trim(replace(map[Summary]; “#”; “”)); " ")[1] - how do I use Makes code to tell it to extract the first word and trim off the #. When I simply type these values in (# and [1]) Make treats it as plain text.
It’s very difficult to explain as my knowledge is limited but I’m hoping someone gets this.
Maybe the screen shot will help my explanation.
What have you tried so far?
to many to list…
Screenshots: scenario setup, module configuration, errors
Hello and welcome to the community!
Please tell us a little bit more about how your event title is structured and whether it’s created using third-party software like a contact form or not.
You should keep in mind that some people use two first names, and the same applies to surnames- they aren’t always a single word.
Using simple parsers like the ones suggested will only work for basic names like Joe Doe.
But what if your client uses Sarah Jessica Parker (first name, middle name, surname) or Anna Maria Lopez Garcia (first name, middle name, surname, surname)?
So using Text Parse (regex) would be a better solution but still not perfect.
The best (most reliable) approach would be if the event were created through some kind of form that returns exact first names and surnames to avoid problems.
Lastly, you can clean the event title (delete the phone number to avoid providing personal data) and use AI to generate JSON with the first name and surname. That’s the easiest solution to implement.
Thanks for your reply.
I cant generate this info through a form. I create the calendar entry while on the phone booking the appointment with the customer. I just type the details in to my calendar entry as the customer is telling me over the phone. This is the simplest and fastest way to do this - and it’s worked well for the past 6 years.
Using a middle name has not been an issue for the past 6 years, so it’s a none issue going forward. If that problem does pop up, I’ll just manually process the invoice.
If I didn’t want to use AI to generate, are there any other ways to do this?
Understand.
You have not provided your default calendar event tittle so I assume it is:
#Joe Doe +00123456789
Here you can find few examples how to handle that- both using Regex and Make functions. There is example showing you how function is built and how does it work.
Apologies.
That is correct:
# John Doe 0455584454
Thank you. I’ll check it out.
Thank you for sharing this with me.
I now see how the syntax works and how to pass variables.
Much appreciated.
1 Like