cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Extract phone number and name from a calendar invite for Twilio

Hi all,

 

I would like to send appointment reminders through Twilio and O365 Calendar:

 

The body of the invite looks like this:

 

***

Customer Info

--------------------

Name: John Doe

Email: xxxxxx@xxxxx.com

Phone Number: xxxxxxxxxx

 

Booking Info

--------------------

Service name: Initial consult

Location: Our office address

 

The Trigger I picked is "When an upcoming event is starting soon (V2)"

 

The Action I picked is "Twilio Send Text Message (SMS)" action which requires: From Phone Number, To Phone Number, and Text.

 

I want the To Phone Number to be the phone number from the invite body above in green and the Text to say "Hi (name from body), your appointment is confirmed for (start date and time of the invite) at (Organizer of the invite). Here is our address: (Address from the location field above)."

 

What should I put in the To Phone Number and Text fields to get this output?

 

Thank you in advance and I appreciate any help!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Extract phone number and name from a calendar invite for Twilio

Hi @flowrookie,

 

Do you want to extract Phone Number, Name, Email, etc. from the event body?

Please take the following configuration for a reference.

Add the trigger When a new event is created.

Add action Html to text.

Add Compose action, use the following code to get the starting position of the number.

add(indexOf(body('Html_to_text'),'Phone Number'),13)

 Add Compose 2, use the following code to get the starting position of Booking info.

indexOf(body('Html_to_text'),'Booking info')

 Add Compose 3, use the following code to extract Phone Number:

substring(body('Html_to_text'),outputs('Compose'),sub(outputs('Compose_2'),outputs('Compose')))

 1.PNG2.PNG

The same way with Name, Email, etc. Please take a try with it on your side.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Frequent Visitor

Re: Extract phone number and name from a calendar invite for Twilio

I was able to get the phone number correctly but there is a carriage return after the number. Does anyone know how I can remove that?

 

first(skip(split(first(split(body('Html_to_text'),'Booking Info')),'Phone Number: '),1))

Also, how do I upload images to these posts. I tried the "Insert/edit image" button but it doesn't give me an option to pick an image from my desktop.

 

Highlighted
Community Support
Community Support

Re: Extract phone number and name from a calendar invite for Twilio

Hi @flowrookie,

 

Do you want to extract Phone Number, Name, Email, etc. from the event body?

Please take the following configuration for a reference.

Add the trigger When a new event is created.

Add action Html to text.

Add Compose action, use the following code to get the starting position of the number.

add(indexOf(body('Html_to_text'),'Phone Number'),13)

 Add Compose 2, use the following code to get the starting position of Booking info.

indexOf(body('Html_to_text'),'Booking info')

 Add Compose 3, use the following code to extract Phone Number:

substring(body('Html_to_text'),outputs('Compose'),sub(outputs('Compose_2'),outputs('Compose')))

 1.PNG2.PNG

The same way with Name, Email, etc. Please take a try with it on your side.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Extract phone number and name from a calendar invite for Twilio

Hi @v-yamao-msft,

 

What you suggested almost worked, there is a carriage return after the phone number since there is a blank line before "Booking Info". How do I eliminate this carriage return?

 

I can't figure out how to add an image to this post so I uploaded it. Here is the link:

 

https://ibb.co/dqGBxq

 

Thanks for all your help.

Highlighted
Community Support
Community Support

Re: Extract phone number and name from a calendar invite for Twilio

Hi @flowrookie,

 

Please try to use a Trim function to remove leading and trailing whitespace from a string.

Besides, please click the Photo icon to upload images.

1.PNG

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (10,297)