How do I write holiday schedules from API results via script?

Alex Tagg
Tera Contributor

I have a working Scheduled Job calling a Script Include which in turn access a REST Message to Google Calendar and successfully retrieves a JSON response containing the dates of U.K. Bank Holidays. 

I want to be able to write a script which adds the relevant data (summary name, start and end dates etc.) to a Schedule I created called U.K. Holidays. However, I'm unsure how to write them into the schedule entries. If this isn't the correct place to look at either, then where would be. 

Any help on which table I should be looking to record this data to would be appreciated.

1 ACCEPTED SOLUTION

@Alex Tagg 

just create record using GlideRecord

sharing useful link

Adding Schedule entries via workflow script?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Once you create the schedule you can use the same script to create schedule entries and link it with your schedule which you created as part of your script

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur, pleased to hear I'm on the right track with this though I can't find any documentation on how I can write to one of these entries. Would you be able to provide a link? Thanks

@Alex Tagg 

just create record using GlideRecord

sharing useful link

Adding Schedule entries via workflow script?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

maheshchokkara
Tera Contributor

Hello @Ankur Bawiskar  
the above link is archived could you please reshare once it will be helpful for me