cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Flow_Lover
Regular Visitor

"Invalid Attendee Email" upon create an event in Google Calendar

Hi Microsoft Power Automate Community,

 

I have an issue trying to set an array of email to Google Calendar event.

 

Set Variable - email:

items('Apply_to_each_2')?['Emails']

 

Compose - Inputs:

variables('email')

 

Compose 2 - Inputs:

split(outputs('Compose'),';')

 

Create an Event - Google Calendar:

string(variables['email'])

 

My current output for string(variables['email']) is xxx@gmail.com;xxx1@gmail.com

I have them connected with ';', but I am not sure why the email is invalid, when a certain array has only one email, the Google Calendar event is added successfully.

 

Thanks a ton for your help.

4 REPLIES 4
v-yiwenxie-msft
Microsoft
Microsoft

Hi @Flow_Lover 

 

The reason why you get error is that your ‘set variable’ is wrong. If you use items() for ‘set variable’, then the variable will be refreshed each time and the variable will consistently only have one email address (even though the email address may differ each time) in it.

 

If you want to save many email addresses in an array and convert them into string separated by ‘;’, the following whole flow is for your reference:

 

Here I use a column named ‘email address’ from excel table and I want to get all the values in this column to let me send an email.

2.18-6.PNG

 

The detailed steps for ‘initialize variable’:

2.18-7.PNG

 

The detailed steps for ‘Apply to each’:

The reason why I use ‘append to array variable’ rather than ‘set variable’ lies in:

The 'set variable' action will reset the variable, which erases all the content formerly exist in the variable.

The 'append to array variable' action will add new content to the variable and retain the content formerly exist.

2.18-8.PNG

The ‘Value’ in ‘Append to array variable 2’ is:

{"emails":@{variables('email')}}

 

The detailed steps for ‘compose’:

2.18-9.PNG

‘Compose’:

last(variables('email array'))

 

‘Compose 2’:

outputs('Compose')?['emails']

 

‘Compose 3’:

join(outputs('Compose_2'),';')

 

For more info about last(), outputs(), join():

Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

 

The result of my test is:

2.18-10.PNG

 

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

Hi, thank you so much! I will look at this and try it for myself! I'll update you till then!

Hi! I forgot to mention that in my email columns there's actually a lot of emails like this:

 

I already did something like Column W: xxx1@gmail.com;xxx2@gmail.com;xxx3@gmail.com

 

I am not sure why it doesn't work hmm.

 

Flow_Lover_0-1613978849494.png

 

Thanks!

v-yiwenxie-msft
Microsoft
Microsoft

Hi @Flow_Lover 

 

There may be some problem with your flow.

Could you take a detailed screenshot of your flow and detailed error?

 

If your email addresses are like xxx1@gmail.com;xxx2@gmail.com;xxx3@gmail.com, then it should not be in a invalid structure. But please make sure there is no leading and trailing whitespace in this email string. 

 

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

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,331)