Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more 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

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

Part 2. In this video i have talked about overview on ServiceNow platform/tool. How you can opt for personal dev instance (PDI)? how to login in ServiceNow instance and navigation to OOB modules. For document please visit: https://servicenowwithrunjay.com/ Follow Facebook page for latest update on

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

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

Part 2. In this video i have talked about overview on ServiceNow platform/tool. How you can opt for personal dev instance (PDI)? how to login in ServiceNow instance and navigation to OOB modules. For document please visit: https://servicenowwithrunjay.com/ Follow Facebook page for latest update on

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.