Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Get schedule information via REST API.

matteoking4
Kilo Contributor

Hi all,

I am searching for a solution to get the schedule entry data from a custom schedule tabl(that extends the cmn_schedule table). 

find_real_file.png

When I use the table API and do a get request. I receive all the information about that schedule, but nothing related to its entries. If anybody can explain how this works, it would be greatly appreciated.

Thanks,

Mat

 

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Mat,

That is because the schedule entries table is different than the cmn_schedule and you are running the table API on cmn_schedule table.

To get the schedule entries use table API for table cmn_schedule_span and pass the schedule sys_id.

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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 Mat,

That is because the schedule entries table is different than the cmn_schedule and you are running the table API on cmn_schedule table.

To get the schedule entries use table API for table cmn_schedule_span and pass the schedule sys_id.

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur, Thank you! You are right.

If I query the cmn_schedule_span table, I can get all the entry information + the sys_id of the cmn_schedule record. 

Hi Ankur, I have one more question :).

You can get the time information from the cmn_schedule_span. It also contains a reference to the schedule located in the cmn_schedule table. 

My question is now if you can get the entry(cmn_schedule_span) from the cmn_schedule table record. So if I query a random table that references the cmn_schedule table, I get the entry values(cmn_schedule_span) from that schedule. Some value like schedule.entry.start_date_time.

 

Greetings

 

Mat

Hi Mat,

Can you explain what you want to ask in detail?

Regards

Ankur

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