Creating calendar invites using ICS attachments

Attached herein is a public example app showing how to use an ICS template to send a calendar event email to recipients. A few comments in no particular order:

  1. online help for this feature: https://help.appsheet.com/en/articles/3568441-adding-a-calendar-ics-attachment-to-an-email

  2. This feature has just dropped, so apologies in advance for any errors or omissions. And, feedback most welcome here!

  3. The example app attached here has a parent-child relationship: the parent is the calendar entry, and the children are the email recipients. Here is the app link:

https://www.appsheet.com/samples/Sample-App-that-generates-a-calendar-invite-whenever-you-add-or-upd...

  1. In the workflow, we will generate an email for any ADDS or UPDATES to a calendar event. The โ€œTOโ€ line is set to:

[Invitees][InviteeEmail]

(i.e. the children of the parent calendar invite item)

  1. The subject line is <<[Subject]>>. The start and end times are the start and end fields. I have not yet tackled timezones so the defaut behavior is โ€œcurrent timezoneโ€ of the client device.

  2. The ICS template is a plain text file that ends in .ics - google sheets (and probably one drive) is somewhat picky about this. As the help article states, you will want to download, edit, and then re-upload the ICS content file with great care. AppSheet will informatively throw an error if you make a mistake during this part of the process.

  3. Lastly, ICS files have a UID field, this is documented somewhat vaguely in the original ietf RFP:

https://tools.ietf.org/html/rfc5545#section-3.8.4.7

which was written in 1998 and last updated in 2009. Lolzโ€ฆ We believe that this UID field does need to support a pretty broad definition of โ€œuniquenessโ€ - in the example we have created a virtual calculation field whose definition is:

concatenate(UniqueID(),"-",UniqueID(),"-",UniqueID(),"-",UniqueID())

(somewhat of a hack, but itโ€™s getting the job done)

  1. Here are the full contents of the ICS file used in this example:

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//AppSheet Inc//AppSheet
    CALSCALE:GREGORIAN
    METHOD:PUBLISH
    X-COMMENT: See https://icalendar.org/validator.html
    BEGIN:VEVENT
    SUMMARY:Meeting about <<[Subject]>>
    UID:<<[ICS_UID]>>
    DTSTART:<<[TimestampStart]>>
    DTEND:<<[TimestampEnd]>>
    LOCATION:<<Here()>>
    DESCRIPTION:This is an invitation to a meeting about <<[Subject]>>
    DTSTAMP:<<Now()>>
    ORGANIZER;CN=<<USERNAME()>>:MAILTO:<<USEREMAIL()>>
    END:VEVENT
    END:VCALENDAR

Let us know here if you have any questions or feedback. Thank you!

9 16 6,175
16 REPLIES 16

This is a great feature! Iโ€™ve tested using a simple start/ end expression in my description field.

โ€œDESCRIPTION:<<Start:[Related Customer_Reservations]>> Company: <<[Company Name]>> <>โ€

It returns the following in the Description body of the email invite

โ€œompany: ASDFG Manufacturingompany: DISTRIBUTOREND:VEVENTโ€

Iโ€™ve used a different value for the company but it should have returned the two companies, ASDFG Manufacturing and DISTRIBUTOR. It seems to leave out the C in Company and include the END:VEVENT as if it is part of the ics email description. Iโ€™m not sure if this is a bug or start/ end expressions arenโ€™t fully supported in the description field but I would greatly appreciate some guidance on this.

Thanks in advance!

Sarah

Iโ€™m not sure why it left it off but after Company: <<[Company Name]>> there is an End statement within double arrows <<>>

This:
โ€œDISTRIBUTOREND:VEVENTโ€

Is a pretty good hint that thereโ€™s a syntax problem in your expression. Can you paste the entire content here using the preformatted text option:

2X_b_b5a1a3b6ef9e987969bd3f86460d01e879fb848e.png

Thanks!

This is wonderful!

One thing I m missing from Calender related function.

On any of calendar and scheduling app, then we selected a day from the calendar and then then try to add event, then form pops up with pre-filled date as selected. However, On the appsheet, adding new event to calendar will open the form with date of TODAY, ignore the selection of the date before opening the form.

Hope you guys will do something to make it far better!

Thanks!

Iโ€™ve also noticed that if you enter to a second line for the description, the calendar invite seems to ignore it and it doesnโ€™t show in the body of the invite. Iโ€™ve tested using a \n when I want to start a new line but that gives an error that my Start doesnโ€™t have a corresponding End.

I think youโ€™re onto something (bug related) here. I changed the original ICS template from my original example so that the description line reads:

DESCRIPTION:<<Start: [Invitees]>><<[InviteeEmail]>><<End>>

And when I tested I received no ICS attachment in my inbox.

I think weโ€™ll need to carefully experiment on an ongoing basis.

Unlike some of the other attachment types, ICS is a pretty nit-picky standard and format - it could very well be that AppSheet dev team has encoded safety checks and conservative handling on this file type. Iโ€™ll check with them as soon as possible.

I thought it might have something to do with the ics attachment as well because the expression works with any other attachment template. Also, \n seems to work well for separating the description in multiple lines but only if you donโ€™t need a start/ end expression in it.

I would eventually like to use another embedded start/ end expression to get grandchild records (guests for each customer all on one reservation) as well as child records. I know this also works with my other attachment templates so Iโ€™m sure itโ€™s contingent on our initial problem.

Thanks for your help with this! Iโ€™ll keep trying different things until thereโ€™s an update.

I see. Thatโ€™s helpful, thanks.

Just to clarify, there really isnโ€™t a good business reason to use a parent-child Start Expression inside of the ICS file itself. Thatโ€™s better kept in an email body, PDF attachment, etc.

The ICS file is meant to be delivered to one person and is meant to have calendar info on it.

Thatโ€™s why the original example we shipped for this post included an email-to which found the โ€œchildrenโ€ of the calendar event โ€œparentโ€, the children in this case were email recipients:

So, even were we to โ€œfixโ€ the ICS start expression item, itโ€™s not very worthwhile from a business point of view.

Hopefully this helps explain it further, and/or, I still may have missed the overall goal/purpose here!

I completely understand that. In our case, the invite gets sent to a group and the reason why itโ€™s important for the users of the app is because they would like the invitation recipients to be able to open their calendar on Outlook, open the event/ meeting and see specific parent, child, and grandchild information in the description. Some of the invite recipients do not have the app so they simply receive a workflow email with the information in the email body. But all of the users would rather open up their calendar and immediately find the event with the important details in the description instead of having to search through all of their emails for the reservation. Hope that gives some explanation of why I am trying to get this working for my users!

If could add a pdf attachment to the invite itself, not the email the invite is delivered on, then that would be great but I donโ€™t know if that would be possible.

thatโ€™s a pretty decent business use case! Thank you.

I can confirm that the logs throw an undesirable error:
"Errors": "Error: Workflow rule 'Send Calendar Invite' action 'Action 1' Attachment template. Contains end token '>>' at offset 14 without matching start token '<<'",

when I insert the following โ€œchildโ€ example in the description line:

<<Start: [Related calendar_lineitems]>> <<[LineItemName]>> <<End>>

Iโ€™ll log a bug and link back to this thread.

Any update on the bug?

Thank you for this function.

Iโ€™m also looking forward for this

We now can add Calender entries via the ICS file.
But with an integration we could also read and edit the calendar.

Hi Sarah,

As Ty said, you uncovered a bug. I made an attempt to fix the bug when you first reported it, but was unsuccessful.

I made another attempt to fix the problem yesterday. In an abundance of caution, I am only releasing the change gradually. If you provide me your account id, I can add you to the list of users getting the fix. That will allow you to see if it fixes the problem you reported.

Hi Phil, is there working sample app that creates an .ics file suitable to create a google calendar entry ? Thankyou,

stephen

@TyAlevizos

Have you been able to tackle time zones? I want to add sending an event invite just to the current user but our users will be in many different time zones so I need to event record to indicate the time zone and have the ICS handle adjusting it to the user running the action time zone.

Hi Lucinda,
I havenโ€™t had a chance to revisit this topic lately. Sorry about that. I am assuming that TIMEZONE is a standard element in the ICS format. Plus, our UTCNOW() function may be of some use here. But thatโ€™s just me typing, until I get some time to test this out again.

Top Labels in this Space