The CreatorCon Call for Content is officially open! Get started here.

multiple Import set api response customization

anuannap123
Tera Contributor

Hi

I am using import set API to insert multiple incidents. But the response is returning import set ID.

Can someone advise how do i get the incident numbers as response

4 REPLIES 4

Runjay Patel
Giga Sage

HI @anuannap123 ,

 

You can query like below.

var importSetId = 'ISET00001';
var result = [];
        var gr = new GlideRecord('sys_import_set_row');
        gr.addQuery('set', importSetId);
        gr.query();
        while (gr.next()) {
            result.push(gr.sys_target_sys_id.number);
        }

 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

thank you. But where do i query this code? do you mean to create one scripted rest api and in script to pass this?

Also this is passing static import set id. how do i get customize the response to return the incident number as soon as the multiple records inserted into incident table 

Hi @anuannap123 ,

 

The place where you had made API call and as a response you are getting import set id.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

Hi @anuannap123 ,

 

Let me know if still required more help.

 

If my answer addressed your query, feel free to accept it to help others in the community benefit as well.