How we can add 51-100 record out of 100 record available in Excel file.

vidishaagarwal5
Tera Contributor

Can we use Transform Script. coz I need to load data via excel sheet?

2 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

Create onBefore transform script and add this
Add your code 

if(source.sys_import_row >= 100 ){ error = true; }

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


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Below Article will Help !!

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745411

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


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

5 REPLIES 5

Ravi Gaurav
Giga Sage
Giga Sage

Hi @vidishaagarwal5 

Create onBefore transform script and add this
Add your code 

if(source.sys_import_row >= 100 ){ error = true; }

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


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Below Article will Help !!

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745411

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


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

vidishaagarwal5
Tera Contributor

This is Awesome .. how fast I got the Answer is really Appreciated!!

Ankur Bawiskar
Tera Patron
Tera Patron

@vidishaagarwal5 

yes this is possible.

you can use onBefore transform script and skip the 1st 50 rows

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

    // Add your code here
    var currentRowNumber = source.sys_import_row;
    if (currentRowNumber < 50) {
        ignore = true;
        log.info('Skipping this row ' + currentRowNumber);
    }

})(source, map, log, target);

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

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