{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":39732,"path":"platform-administration/t_CRiCalendarInvCustomTables.md","title":"Create iCalendar invitations for custom tables","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create iCalendar invitations for custom tables\n\nTo generate iCalendar invitations that use field values from custom tables, create an import export map that computes the values of the iCalendar fields.\n\n## Before you begin\n\nRole required: admin\n\n## Procedure\n\n1.  Create the custom table and fields using the **Date/Time** field type for the fields that map to the *$\\{dtstart\\}* and *$\\{dtend\\}* variables.\n\n2.  In the navigation filter, enter `sys_impex_map.list`.\n\n3.  Click **New**.\n\n4.  Set the following fields:\n\n    -   **Name**: Use the following naming convention: `icalendar.<table name>`. For example, **icalendar.u\\_my\\_custom\\_table**.\n    -   **Table**: Select the custom table you created.\n    -   **Type**: Select **icalendar**.\n5.  Right-click the form header and select **Save**.\n\n6.  In the Field Maps related list, click **New**.\n\n7.  In the Mapping Entry Wizard, select **Mapping to a Database Field**.\n\n8.  Create field mappings for *dtstart* and *dtend*.\n\n    For example, map the **External Name** *dtstart* to the**u\\_meeting\\_start\\_time** field in u\\_my\\_custom\\_table.\n\n    **Note:** These variables are required.\n\n9.  Click **Submit**.\n\n10. Create field mappings for any of the following iCalendar fields as necessary.\n\n    -   dstart\n    -   dtend\n    -   location\n    -   alarm\\_time\n11. Click **Update**.\n\n    Here are sample field mappings between iCalendar variables and custom fields in a custom table, u\\_my\\_custom\\_table:\n\n    |External name|Database field|Type|Map|\n    |-------------|--------------|----|---|\n    |dtstart|u\\_meeting\\_start\\_time|field|icalendar.u\\_my\\_custom\\_table|\n    |dtend|u\\_meeting\\_end\\_time|field|icalendar.u\\_my\\_custom\\_table|\n\n12. Create an email template that defines what to include in the iCalendar invitation.\n\n    1.  Set the **Table** field to the custom table you created.\n\n    2.  In the **Message** text field, use the following format to define the iCalendar invitation.\n\n        ```\n        \n        BEGIN:VCALENDAR \n        PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN \n        VERSION:2.0\n        METHOD:REQUEST \n        BEGIN:VEVENT \n        ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:${to} \n        DTSTART:${dtstart} \n        DTEND:${dtend} \n        UID:${sys_id} \n        DTSTAMP:${dtstamp} \n        SUMMARY:${u_meeting_summary} \n        END:VEVENT \n        END:VCALENDAR\n        \n        ```\n\n        **Note:** Mail script is not allowed or processed in meeting invitation email templates.\n\n        |iCalendar template line|Required?|Notes|\n        |-----------------------|---------|-----|\n        |BEGIN:VCALENDAR|Yes| |\n        |PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN|Yes| |\n        |VERSION:2.0|Yes| |\n        |METHOD:REQUEST|Yes| |\n        |BEGIN:VEVENT|Yes| |\n        |ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:$\\{to\\}|Yes|The $\\{to\\} contains the recipients as defined in the notification.|\n        |DTSTART:$\\{dtstart\\}|Yes|You must use the import export map to map dtstart to a start time field on the custom table.|\n        |DTEND:$\\{dtend\\}|Yes|You must use the import export map to map dtend to an end time field on the custom table.|\n        |UID:$\\{sys\\_id\\}|Yes|You must provide the name of a field that uniquely identifies the record, such as the sys\\_id or the record number field.|\n        |DTSTAMP:$\\{dtstamp\\}|Yes| |\n        |SUMMARY:$\\{u\\_meeting\\_summary\\}|No|To include a summary from a text field on the custom table, provide the name of the field, such as u\\_meeting\\_summary. The summary field value must not contain line breaks. You do not need to create a field mapping.|\n        |END:VEVENT|Yes| |\n        |END:VCALENDAR|Yes| |\n\n13. Create an email notification to trigger the iCalendar invitation and ensure the following fields are set accordingly:\n\n    -   **Table**: Select the custom table.\n    -   **Type**: Select **Meeting Invitation**.\n    -   **Content type**: Select **Plain text** only.\n    -   **Email template**: Select the template you created.\n\n**Parent Topic:**[Calendar integration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/r_CalendarIntegration.md)\n\n"}}