Rupam_39
Giga Guru

Hi Folks,

This article explains how to generate iCalendar attachments in Service Now and send it over as an attachment in email notifications. I came across this requirement and could find any solution over the internet, so I decided to build my own solution.

The actions begins below.....

iCalendar attachments are basically outlook meeting invites attachment that contains details for meeting such as "Meeting Start Date Time", "Meeting End Date Time", "Meeting URL for Joining meeting", "Location" , "Description", etc.
Below is the screenshot of the icalendar attachment in an Email.

find_real_file.png

When the attachment is opened it contains meeting details as shown below.

find_real_file.png

I am able to generate the ICS attachment using a script include. I am also maintaining a table that contains the meeting the details specific for the meeting. The snapshot of a record in the table along with the generated attachment is below.

find_real_file.png

The Script that generates the attachment is below

var ICS_SNOW_AttachmentGenerator = Class.create();
ICS_SNOW_AttachmentGenerator.prototype = {
    
	initialize: function() {
    },
	
	_formatDate: function(dateunformatted){
	
		var formDate = dateunformatted+"";
		formDate = formDate.replace(/\-/g,"");
		formDate = formDate.replace(/\s+/g,"T");
		formDate = formDate.replace(/\:/g,"");
		formDate = formDate + "Z";
		return formDate;
	},
	
	/*
	GRObj is the GlideRecord Object of the record in my custom table containing the details of the meeting.
	*/
	payloadGen: function(GRObj){
		var startDate = this._formatDate(GRObj.meeting_start_date_time);
		var endDate = this._formatDate(GRObj.meeting_end_date_time);
		var payload = "";
		
		payload += "BEGIN:VCALENDAR\r\n";
		payload += "VERSION:2.0\r\n";
		payload += "PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN\r\n";
		payload += "METHOD:REQUEST\r\n";
		payload += "BEGIN:VEVENT\r\n";
		var attendees = GRObj.meeting_attendees;
		var attendees_list = attendees.split(',');
		
                if(attendees_list.length > 0){
			for(var i = 0; i < attendees_list.length; i++){
				payload +=  "ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:" + attendees_list[i] + "\r\n";
			}
		}
		
		payload += "ORGANIZER:MAILTO:teamXYZ@example.com" + "\r\n"; // The ORGANISER tag is generally used to override the email address where the responses will be send, when replied by the attendees for the invites received by them. Moreover, if the value of ORGANISER tag is set then the recipients will receive mails fromm the value mentioned in the organizer tag.
 
		payload += "DTSTART:" + startDate + "\r\n";
		payload += "DTEND:" + endDate + "\r\n";
		payload += "LOCATION:India VRoom" + "\r\n"; // you can use variable, if you are maintaining VRooms for your meetings;
		payload += "TRANSP:OPAQUE" + "\r\n";
		payload += "UID:" + new GlideEmailWatermark().optionallyRandomize(GRObj.u_number) + "\r\n";
		payload += "DTSTAMP:" + this._formatDate(new GlideDateTime().getValue()) + "\r\n";
		payload += "DESCRIPTION:You are requested to join the meeting for the discussion of XYZ Request\r\n"; //provide your own mwssage or populate using variables.
		payload += "SUMMARY:Meeting Invite for XYZ Request\r\n";
		payload += "PRIORITY:5\r\n"; // can take values from 0 to 9 "0 to 4 HIGH Priority, 5 MODERATE PRIORITY, 6 to 10 LOW PRIORITY".
		payload += "X-MICROSOFT-CDO-IMPORTANCE:1\r\n"; //can take values from 0 to 2. Specifies the importance of an appointment.
		payload += "CLASS:PUBLIC\r\n";
		payload += "BEGIN:VALARM\r\n";
		var alarm_time = 10; 
		payload += "TRIGGER:-PT" + alarm_time +"M\r\n"; // The TRIGGER take values in MINUTES and the VALARM EEVENT triggers a reminder message on the recipients screen 10 minutes before meeting start.
		payload += "ACTION:DISPLAY\r\n";
		payload += "DESCRIPTION:Reminder\r\nEND:VALARM\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
		
		gs.info(payload);
		
		var gAttach = new GlideSysAttachment();
		gAttach.write(GRObj, "Meeting_Invite[" + new GlideDateTime().getValue() + "].ics", 'text/calendar', payload);
	},
    type: 'ICS_SNOW_AttachmentGenerator'
};

 

Once the attachment is generated and attached to your meeting record the road is simple and easy. In order to send the attachment on an email, go to Notification Module > Create a Notification and in "What it will Contain" tab, check the "Include Attachment" checkbox. Show your creativity in HTML box for your email and give it a personalize touch.



Enjoy....


This solution doesn't make use of Service Now ICS field maps templates and being restricted to plain text only. It allows you to freely include HTML in your meeting invites and build your custom meeting invites attachments.

Comments
VivekSattanatha
Mega Sage
Mega Sage

Good Job. Thanks for sharing

Deepak23
Tera Contributor

Good one.

akash_k
Kilo Contributor

Thanks Rupam !!!

 

caas
Tera Expert

Thank for sharing saved a lot of time for me 🙂 

chanikya
Kilo Sage

Hi,

here i have same kind of request.

we have created TimeOff request(catalog item)   with Planned StartDate: 20-03-2019  Planed EndDate : 27-03-2019

iCalender should be like invitation attachment in Mail with Start and End Dates 


if I requested Monday the 18th off
​coming to attachment level just thinking about that one only
the ics file should be for 8-5 eastern time that I can just add to my calendar
​or if it's half day or whatever

Any suggestions please

Catalog item

 

Notification:

Rupam_39
Giga Guru

Hi Chanikya,

Your lines

"if I requested Monday the 18th off
​coming to attachment level just thinking about that one only
the ics file should be for 8-5 eastern time that I can just add to my calendar
​or if it's half day or whatever"

Are you asking that if you have added 18th off to your calendar?

chanikya
Kilo Sage

yes, exactly..

 

for example:. if you are in TimeOff form 20-03-2019 To 29-03-2019, your manager approvers your timeoff, then after you will receive one mail like You Time off request approved , in that mail it should contain attachment about your time off details and add to your Calender,

 

if any one see you calender they can easly understand you are in Time off.

So any valuable suggestions please

 

Rupam_39
Giga Guru

Hi Chanikya,

I think you are mistaken. My article is for generating ICS attachment, which is nothing but a meeting invite attachment that you see in "OUTLOOK".

chanikya
Kilo Sage

How to do same kind of customisation on my customisation table. How to send meeting invitation from servicenow to Outlook mail.

My customisation table : Sales (u_saled)

Fields Requesting for, startDate(u_start_date) EndDate(u_end_date) Short Description

When record was created with all fields information send mail to Request for Outlook mail id with a iCalendar invitation attachment

So How can we generate ICS attachment which is nothing but a meeting invite attachment that in "OUTLOOK".

 

 

I have used your script like this, where I need to call table name in script? 

Where I need to call script include??

 

Script Include:

var ICS_SNOW_AttachmentGenerator = Class.create();
ICS_SNOW_AttachmentGenerator .prototype = {
initialize: function() {
},
_formatDate: function(dateunformatted){

var formDate = dateunformatted+"";
formDate = formDate.replace(/\-/g,"");
formDate = formDate.replace(/\s+/g,"T");
formDate = formDate.replace(/\:/g,"");
formDate = formDate + "Z";
return formDate;
},

/*
GRObj is the GlideRecord Object of the record in my custom table containing the details of the meeting.
*/
payloadGen: function(GRObj){
var startDate = this._formatDate(GRObj.u_start_date);
var endDate = this._formatDate(GRObj.u_end_date);
var payload = "";

payload += "BEGIN:VCALENDAR\r\n";
payload += "VERSION:2.0\r\n";
payload += "PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN\r\n";
payload += "METHOD:REQUEST\r\n";
payload += "BEGIN:VEVENT\r\n";
var attendees = GRObj.meeting_attendees;
var attendees_list = attendees.split(',');

if(attendees_list.length > 0){
for(var i = 0; i < attendees_list.length; i++){
payload += "ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:" + attendees_list[i] + "\r\n";
}
}

payload += "ORGANIZER:MAILTO:teamXYZ@example.com" + "\r\n"; // The ORGANISER tag is generally used to override the email address where the responses will be send, when replied by the attendees for the invites received by them. Moreover, if the value of ORGANISER tag is set then the recipients will receive mails fromm the value mentioned in the organizer tag.

payload += "DTSTART:" + startDate + "\r\n";
payload += "DTEND:" + endDate + "\r\n";
payload += "LOCATION:India VRoom" + "\r\n"; // you can use variable, if you are maintaining VRooms for your meetings;
payload += "TRANSP:OPAQUE" + "\r\n";
payload += "UID:" + new GlideEmailWatermark().optionallyRandomize(GRObj.u_number) + "\r\n";
payload += "DTSTAMP:" + this._formatDate(new GlideDateTime().getValue()) + "\r\n";
payload += "DESCRIPTION:You are requested to join the meeting for the discussion of XYZ Request\r\n"; //provide your own mwssage or populate using variables.
payload += "SUMMARY:Meeting Invite for XYZ Request\r\n";
payload += "PRIORITY:5\r\n"; // can take values from 0 to 9 "0 to 4 HIGH Priority, 5 MODERATE PRIORITY, 6 to 10 LOW PRIORITY".
payload += "X-MICROSOFT-CDO-IMPORTANCE:1\r\n"; //can take values from 0 to 2. Specifies the importance of an appointment.
payload += "CLASS:PUBLIC\r\n";
payload += "BEGIN:VALARM\r\n";
var alarm_time = 10;
payload += "TRIGGER:-PT" + alarm_time +"M\r\n"; // The TRIGGER take values in MINUTES and the VALARM EEVENT triggers a reminder message on the recipients screen 10 minutes before meeting start.
payload += "ACTION:DISPLAY\r\n";
payload += "DESCRIPTION:Reminder\r\nEND:VALARM\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";

gs.info(payload);

var gAttach = new GlideSysAttachment();
gAttach.write(GRObj, "Meeting_Invite[" + new GlideDateTime().getValue() + "].ics", 'text/calendar', payload);
},
type: 'ICS_SNOW_AttachmentGenerator '
};

 

 

 

So any suggestion here please

chanikya
Kilo Sage

How to do same kind of customisation on my customisation table. How to send meeting invitation from servicenow to Outlook mail. My customisation table : Sales (u_saled) Fields Requesting for, startDate(u_start_date) EndDate(u_end_date) Short Description When record was created with all fields information send mail to Request for Outlook mail id with a iCalendar invitation attachment.

 

I  used your script, but in script include where I need to mention my table name???

Where I need to call this script include??

Rupam_39
Giga Guru

If that is the case then you can call my above script include function payloadGen() using the GlideRecord object of the table record containing the details of the invite. The GlideRecord object of the record should have meeting attendees list, start date and end date. Once called, this Script include will generate the attachment and will attach it to the GlideRecord object containing the meeting details.

You should have a notification configured to include attachments, so as to post emails containing the ICS attachment. 

Rupam_39
Giga Guru

You need to do a glideRecord first to your record containing the meeting details and pass that glideRecord object to my function payloadGen().

chanikya
Kilo Sage

My table name is : u_sales

Fields are : start date(u_start_date), End date (u_end_date)

Requesting for,

Short description this fields only I have in table

This is your script include, so where I need to call u_sales table name in script please var ICS_SNOW_AttachmentGenerator = Class.create(); ICS_SNOW_AttachmentGenerator.prototype = { initialize: function() { }, _formatDate: function(dateunformatted){ var formDate = dateunformatted+""; formDate = formDate.replace(/\-/g,""); formDate = formDate.replace(/\s+/g,"T"); formDate = formDate.replace(/\:/g,""); formDate = formDate + "Z"; return formDate; },

/* GRObj is the GlideRecord Object of the record in my custom table containing the details of the meeting. */

payloadGen: function(GRObj){ var startDate = this._formatDate(GRObj.meeting_start_date_time); var endDate = this._formatDate(GRObj.meeting_end_date_time); var payload = "";

payload += "BEGIN:VCALENDAR\r\n"; payload += "VERSION:2.0\r\n"; payload += "PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN\r\n";

payload += "METHOD:REQUEST\r\n"; payload += "BEGIN:VEVENT\r\n";

var attendees = GRObj.meeting_attendees;

var attendees_list = attendees.split(',');

Suggest me please

Rupam_39
Giga Guru

For my Implementation I used a UI Action on my custom table containing meeting records and from the script box of the UI Action, i used the below script.

 

new ICS_SNOW_AttachmentGenerator().payloadGen(current);

Where current is a GlideRecord object pointing to my record containing meeting details.

In your case you can also have a UI Action on your u_sales table. You can also use the above script line in any one of the server side script box, with a Glide Record object pointing to your meeting invite record.Y

NOTE: You may have to make changes to the variable name used in my script include, as i see the variables used in your table are u_start_date, u_end_date and in my tables these are "meeting_start_date_time" and "meeting_end_date_time".

Hope this answers your question.

chanikya
Kilo Sage

find_real_file.png

 

Script include:

var ICS_SNOW_AttachmentGenerator = Class.create();
ICS_SNOW_AttachmentGenerator .prototype = {
initialize: function() {
},
_formatDate: function(dateunformatted){

var formDate = dateunformatted+"";
formDate = formDate.replace(/\-/g,"");
formDate = formDate.replace(/\s+/g,"T");
formDate = formDate.replace(/\:/g,"");
formDate = formDate + "Z";
return formDate;
},

/*
GRObj is the GlideRecord Object of the record in my custom table containing the details of the meeting.
*/
payloadGen: function(GRObj){
var startDate = this._formatDate(GRObj.u_start_date);
var endDate = this._formatDate(GRObj.u_end_date);
var shortdescri = this.getParameter(GRObj.u_short_description);
var req=this.getParameter(GRObj.u_requested_for);
var payload = "";

payload += "BEGIN:VCALENDAR\r\n";
payload += "VERSION:2.0\r\n";
payload += "PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN\r\n";
payload += "METHOD:REQUEST\r\n";
payload += "BEGIN:VEVENT\r\n";


//var attendees_list = attendees.split(',');

// if(attendees_list.length > 0){
// for(var i = 0; i < attendees_list.length; i++){
payload += "ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:" + req + "\r\n";
// }
// }

//payload += "ORGANIZER:MAILTO:teamXYZ@example.com" + "\r\n"; // The ORGANISER tag is generally used to override the email address where the responses will be send, when replied by the attendees for the invites received by them. Moreover, if the value of ORGANISER tag is set then the recipients will receive mails fromm the value mentioned in the organizer tag.

payload += "DTSTART:" + startDate + "\r\n";
payload += "DTEND:" + endDate + "\r\n";
payload += "LOCATION:India VRoom" + "\r\n"; // you can use variable, if you are maintaining VRooms for your meetings;
payload += "TRANSP:OPAQUE" + "\r\n";
payload += "UID:" + new GlideEmailWatermark().optionallyRandomize(GRObj.u_number) + "\r\n";
payload += "DTSTAMP:" + this._formatDate(new GlideDateTime().getValue()) + "\r\n";
payload += "DESCRIPTION:You are requested to join the meeting for the discussion of XYZ // Request\r\n"; //provide your own mwssage or populate using variables.
payload += "SUMMARY:"+ shortdescri +"\r\n";
payload += "PRIORITY:5\r\n"; // can take values from 0 to 9 "0 to 4 HIGH Priority, 5 MODERATE PRIORITY, 6 to 10 LOW PRIORITY".
payload += "X-MICROSOFT-CDO-IMPORTANCE:1\r\n"; //can take values from 0 to 2. Specifies the importance of an appointment.
payload += "CLASS:PUBLIC\r\n";
payload += "BEGIN:VALARM\r\n";
var alarm_time = 10;
payload += "TRIGGER:-PT" + alarm_time +"M\r\n"; // The TRIGGER take values in MINUTES and the VALARM EEVENT triggers a reminder message on the recipients screen 10 minutes before meeting start.
payload += "ACTION:DISPLAY\r\n";
payload += "DESCRIPTION:Reminder\r\nEND:VALARM\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";

gs.info(payload);

var gAttach = new GlideSysAttachment();
gAttach.write(GRObj, "Meeting_Invite[" + new GlideDateTime().getValue() + "].ics", 'text/calendar', payload);
},
type: 'ICS_SNOW_AttachmentGenerator '
};

 

 

Suggest me please where i am doing wrong here.

Rupam_39
Giga Guru

From where you are calling the script include. Is it from a Business Rule, UI Action or somewhere else. 

chanikya
Kilo Sage

could you like to check in my instance, i can provide credentials

dev49888  - abel.tuter / 1234

From UI Action

find_real_file.png

Rupam_39
Giga Guru

OK.... I'LL CHECK.... Give me some time, i'll revert back.

Rupam_39
Giga Guru

Hi Chanikya,

Made a couple of changes in the script include. Can you please check now.

chanikya
Kilo Sage

Not showing any meeting name here, So to achieve this what we do?

find_real_file.png

For Example:i would like to see as below screenshot 

find_real_file.png

find_real_file.png

 

Rupam_39
Giga Guru

So, as this is an attachment on an email. You need to open the ICAL invite attachment and save it to your calendar in order to be added to your Calendar to do list. 

There is also a Servicenow suggested method where you will not get this meeting invite as an attachment in an email, but as a direct email, with options to Accept and Reject. In this type the email's body is only capable of containing plain text and not HTML. Below is the link to the servicenow docs that helps to build the same.

https://docs.servicenow.com/bundle/london-servicenow-platform/page/administer/notification/reference...


https://docs.servicenow.com/bundle/london-servicenow-platform/page/administer/notification/task/t_Ma...

 

https://docs.servicenow.com/bundle/london-servicenow-platform/page/administer/notification/task/t_CR...

chanikya
Kilo Sage

before coming to check your article , i seen this link

https://docs.servicenow.com/bundle/london-servicenow-platform/page/administer/notification/reference...

 

i got errors  , for this i raised

 https://community.servicenow.com/community?id=community_question&sys_id=f604ae0cdb5cf7c05129a851ca961993

Result is below:

Pic in my Gmail account:

find_real_file.png

 

Pic from :  Outlook

find_real_file.png

Rupam_39
Giga Guru

Kindly check now.

Rupam_39
Giga Guru

On your personal developer instance. I made some changes, for your unsupported format.

chanikya
Kilo Sage

Can  you suggest me where you have done changes please.?

 please let me know, in your script include ? Or Some where else?

Rupam_39
Giga Guru

I moved the the template in email template from "Message HTML" field to "Message Text" field.

https://dev49888.service-now.com/sysevent_email_template.do?sys_id=838d520c4f503300651f2f9ca310c77d&...

chanikya
Kilo Sage

i think we need to add Template  in Email Template field.am i right please? 

 

what are the steps we are following here

1.Script Include

2. UI Action

3.Event Registry 

4. Meeting Invites for Sales (notification)

am i right please?

Rupam_39
Giga Guru

Of course, if you are using the method which ServiceNow describes in docs, then definitely you need to include the meeting template in your Notifications, and your notification type should be also Meeting Invitation

Dead Blade
Kilo Guru

This defaults the calendar invite to UDT time.  How can I convert the start and end times to PST time as a default?  The actual goal is to have the start and end times per the users Outlook time zone.  If I am PST then the start and end will be PST on my calendar, if I am EST then the start and end will be EST on my calendar.  Has anyone figured this out?

Dead Blade
Kilo Guru

Hello, what I noticed is this line:

formDate = formDate + "Z";

controls changing the startDate, endDate from UTC to local time.  But it also adds a "Z" to the end of the change number, example.. CHG0003456Z instead of CHG000456.  Is there a method to remove the Z without commenting out:

formDate = formDate + "Z";

 

 

Dead Blade
Kilo Guru

Figured it out.  I used the .slice attribute.

 

 

pooja V1
Mega Guru

@Rupam @chanikya 
I created the script include and calling that script include from a business rule.
Now I am confuesd, how can I use this script include in email notification or how should I call the email notification ?
Can anyone of you please help me with this?

pooja V1
Mega Guru

Hello @Rupam @chanikya 

Attached business, script include and notification. An email is sent out with the attachment, but the file says not supported to open. I attached the screenshot of email attachment too. Please have a look and help me how I can complete this task.

Thanks,

Pooja

Rupam_39
Giga Guru

Hi Pooja,

Does the current object that you are passing to the script include contains start date, end date, meeting attendees and a number field?

If possible can you please share the .ics file attached to your record on Walk-up appointment table?
It would be helpful for debugging.

I am also assuming that the Business rule is also written on Walk-up appointment table?

pooja V1
Mega Guru

@Rupam unable to attach the .ics file, so I took a screen short and added as attachment. The business rule is also the walk-up appointment table. Also, attached the screen short of how walk-up record looks like.

Rupam_39
Giga Guru

Download the attachment in the record and save it on your computer. Right click on it and click on open with-> Notepad.

Check the content in the notepad. Send me the screenshot of that.

pooja V1
Mega Guru

Opened in notepad++, attached the file, please look.

Thank you

Rupam_39
Giga Guru

I checked your screenshot and compared with the ICS file generated for my use case and I found that there are couple of tags missing below

ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:XYZ@outlook.com
ORGANIZER:MAILTO:ABC@gmail.com

I further checked the code screenshot provided by you and found that the code for ATTENDEE, ORGANISER and UID is commented by you.

.ics file are strict in format and the tags used in the code above are all mandatory for the file. You need to have all the tags in your .ics file. For UID tag you can use this as an alternative if you don't want to use GlideEmailWaterMark().

"UID:" + GRObj.getValue("sys_id") + "\r\n";

I am also attaching the .ics file generated by me using the same code in text format.

Hopefully that should solve the issue.


 

pooja V1
Mega Guru

Hello @Rupam 

As you mentioned I updated the script include with all the tags necessary. Still When the email is received it says unsupported. But, when I downloaded the file and clicked on it, it worked this time and showed all the times and information and also gave accept, reject buttons.

Attaching the ICS file, and how email looked like.

I have a question here, when we click on the attachment in email, it has accept, reject and other buttons, can we just have add to calendar button(which will just add like a appointment to our outlook calendar) ?

Please help me to resolve my issue.

Thanks,

Pooja

Rupam_39
Giga Guru

Hi Pooja,

The "Add to Calendar" button is already there in Outlook Web Clients, and for Outlook app it shows when you double click on the attachment. For me, it does ask for "Add to Calendar". I tried using both outlook web client and outlook app. Below are the screenshots of the same

In OUTLOOK WEB CLIENT hover over the icon, in left of the drop down icon, as shown in the highlighted part of the image below. It says "Add to Calendar".
find_real_file.png

 

OUTLOOK WEB CLIENT: WHEN DOUBLE CLICKED on the Meeting Invite attachment file, a popup opens providing a button on top to add it to the calendar.

find_real_file.png

 

OUTLOOK APP: POPUP when double-clicked on attachment file

find_real_file.png

 

Also confirm, whether the "Include Attachments" checkbox is checked in your notification or not.

find_real_file.png

pooja V1
Mega Guru

Hello @Rupam 

yes, I see the 'add to calendar button' near attachment.

'include attachment' button i also checked on notification, still the attachment shows as unsupported file. not sure why.

thanks,

Pooja

Rupam_39
Giga Guru

Hello Pooja,

So are you using the outlook web client or outlook app?
I assume outlook web app.

I can help in debugging the code, I assume some filed values are going wrong in the payload, but do let me know how can we connect.

Thanks & Regards,
Rupam

pooja V1
Mega Guru

@Rupam 
I copied all my code to personal instance and tested it shows the same issue.
https://dev80072.service-now.com/nav_to.do?uri=%2Fhome.do
This is the link to my personal instance.
username - admin

Password - Admin123$
--------------------------------------------------------------
Script Include - ICS_SNOW_AttachmentGenerator
Notification - Schedule Meeting Invite
Business Rule - appointment meeting invite
--------------------------------------------------------------
To test this, need to schedule appointment in below link.
https://dev80072.service-now.com/walkup?id=walkup_online_checkin&sysparm_domain_restore=false&syspar...

Then you can view the scheduled appointment in 'wu_appointment' table.

Thanks,

Pooja

Rupam_39
Giga Guru

Hi Pooja,

The notification record wasn't properly configured. It should be of TYPE: EMAIL as it is bearing an attachment and Content Type: HTML and Plain Text as shown below in the screenshot.

find_real_file.png

It worked properly after this and no change in code was made. See the screenshot below and check your mail as well. Also ensure that your record on wu_appointment table has no duplicate attachments.

Once confirmed with the solution, don't forget to edit your personal dev password. 

find_real_file.png

 

Thanks & Regards,
Rupam

pooja V1
Mega Guru

Hello @Rupam ,
Yes it is working absolutely fine, and thanks a lot for taking sometime to look into the issue.I appreciate for the work you have done.

And one last question, how can make the script include not create multiple attachments?

Thanks,

Pooja

 

Rupam_39
Giga Guru

Hi Pooja,

It is not the script that is creating multiple attachments. You need to check in your trigger before calling the script include that the record on which you are trying to send meeting invite has attachment already or not. In case it has attachment delete the old attachment first and then call the script include to generate the new meeting attachment file (but this is just me, you can have your own thinking to handle duplicates over this case, like generating a separate meeting invite altogether, it is up to your requirements). 

You can check if a record has attachments or not using the <GlideRecordObj>.hasAttachments() , where <GlideRecordObj> is the glide record object of the record on which you want to check, and then take the action appropriately.


mariasilva
Tera Contributor

How do I update the data within the .ics file when the change is rescheduled. In other words, when the data is changed?

Version history
Last update:
‎11-14-2018 01:30 AM
Updated by: