Re: Creating a calendar file with dynamic dates/times

Trinity_Levens3
Level 3

Re: Creating a calendar file with dynamic dates/times

It worked!!!  Thank you!!!!   This is pretty sweet.  Is there a way to check on other time zones like GMT and SGT?  If not no big deal as I can figure out the time differentials.  

I know we deal with this quite a bit, can't even access Gmail, most sites are denied.  We have strict network policies and rightly so.  You're the best Sandy!! 

SanfordWhiteman
Level 10 - Community Moderator

Re: Creating a calendar file with dynamic dates/times

It worked!!! Thank you!!!! This is pretty sweet. Is there a way to check on other time zones like GMT and SGT? If not no big deal as I can figure out the time differentials.

Well, GMT is (basically) UTC. But you probably mean GMT/BST (with the Daylight Savings switch).

You can't compute that from a machine that isn't in the GMT timezone (without preloading the timezone database into your browser, which as I mentioned is something that moment.js and other plugins can do, but I don't have the time to flesh out the builder like that).

Shashank_Sharma
Level 2

Re: Creating a calendar file with dynamic dates/times

Thanks Sanford Whiteman​! This is really helpful and easy to setup. Now, I'm running into another challenge where the webinar url(populated via the On24 integration {{member.Webinar URL}}) is not populated in the ICS file description properly. Since the webinar URL has multiple query strings (E.g. https://event.on24.com/interface/registration/autoreg/index.html?eventid=xxxxxxx&sessionid=1&key=abc...sionid=1&key=abcd1234xyz0987&firstname=abc&lastname=xyz&email=abc@xyz.com), it only populates the URL with only one parameter i.e. https://event.on24.com/interface/registration/autoreg/index.html?eventid=xxxxxxx, and the rest of the param are ignored. Any possible way to include all the query strings? Also, trying to figure out if there's an easier way to put line breaks in the description message.

Thanks,

Shashank Sharma

SanfordWhiteman
Level 10 - Community Moderator

Re: Creating a calendar file with dynamic dates/times

Ah, the URL-inside-URL problem.  Agical already solves for that (and I don't think there's any other platform that deals with it)!

I described the problem and solution here: http://blog.teknkl.com/working-around-mostly-with-unencoded-urls-in-query-strings/

You need to use the /alt_sep/ ("alternate separator") style and separate the other query params with semicolons (;) instead of the more typical ampersand (&). As I note in the blog post, semicolons were the preferred separator in the earliest web standards, though now they're rarely used.

An /alt_sep/ URL can look like this:

ics.agical.io/alt_sep/?subject=Meet%20{{company.Account%20Owner%20First%20Name}};organizer=Sandy;reminder=45;location=https://event.on24.com/interface/registration/autoreg/index.html?eventid=xxxxxxx&sessionid=1&key=abc...sionid=1&key=abcd1234xyz0987&firstname=abc&lastname=xyz&email=abc@xyz.com;dtstart=2016-10-26T15:00:00-04:00;dtend=2016-10-26T16:00:00-04:00;description=Your%0D%0ADescription%0D%0AHere

so with a token you know will contain an unencoded URL:

ics.agical.io/alt_sep/?subject=Meet%20{{company.Account%20Owner%20First%20Name}};organizer=Sandy;reminder=45;location={{member.Webinar URL}};dtstart=2016-10-26T15:00:00-04:00;dtend=2016-10-26T16:00:00-04:00;description=Your%0D%0ADescription%0D%0AHere

As for line breaks, they're encoded as %0D%0A in URLs. I updated the builder to include an optional textarea where you can build the description param.

George_Alucule1
Level 1

Re: Creating a calendar file with dynamic dates/times

Sanford Whiteman‌ is this method still working? I've just tried using it for google cal and everything after event id is being removed. 

Link used: http://ics.agical.io/alt_sep/?subject=test;format=gcal;location={{member.Webinar URL}};dtstart=2016-...

Screenshot 2019-10-21 at 21.40.54.png

Edward_Unthank_
Level 10

Re: Creating a calendar file with dynamic dates/times

If you want to use a Google Calendar link, I wrote up an article a long while ago on how to do this with program tokens. You can pretty easily change those tokens to be lead tokens. They could be populated through the original form via picklist that inputs calendar-friendly format, and then you can put that link behind a pretty button.

pastedImage_2.png

So if you were picking a "choose a good time of day to meet," that could be something like:

  • 8:00-8:30am PDT | 080000
  • 8:30-9:00am PDT | 090000
  • 9:30-10:00am PDT | 093000
  • [etc for picklist options and actual values]

Then you could combine that with Munchtions for both date math (ADD_TO_DATE) as well as date formatting (FORMAT). These could change the lead values and format in a way that would be digestable for the Google Calendar functionality.

Trigger: Lead fills out "calendar setting form."

Flow Step 1: Change data value "Date - Meeting_Date = ##ADD_TO_DATE({{system.date}}, 7,"days")##"

Flow Step 2: Change data value "Date - Meeting_Date = ##FORMAT({{lead.Date - Meeting_Date}},"Ymd")##"

That would spit out +7 days from the current system date (when the trigger is activated) in YYYYMMDD format.

Use those lead tokens instead of program tokens, and you have a dynamic GCal link based on the lead! Or, Sanford and I are working on creating a dynamic ICS generator where you could use the same lead or program tokens.

Cheers,

Edward Unthank | Founder, Etumos