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.

Report creation for variable set

SHUBHAM78
Tera Contributor

I have created one report to fetch the details of one catalogue item, now I am trying to fetch the variable set(multi row) details in that report but not able to do so. I try creating database view but it didn't work. Maybe the database is not 100% correct.

I want to fetch the details of variable set values in the report for this item how can we built  this report. Kindly suggest

1 ACCEPTED SOLUTION

@SHUBHAM78 

you can't do anything there as OOTB ServiceNow stores sysId for reference variables within MRVS

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

13 REPLIES 13

But still sys ID is showing..Do you have any input

 

@SHUBHAM78 

you can't do anything there as OOTB ServiceNow stores sysId for reference variables within MRVS

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar 
Now,I have tried with Onsubmit client script and I have created one variable which will be hidden in portal and fetch the variable set value for the reference variable...But when I submit the request it show error "There is a JavaScript error in your browser console"

Here is the code

function onSubmit() {
var countryList = [];

// Get rows from the multi-row variable set
var rows = g_form.getMultiRowVariableSetRows('please_add_all_the_countries_you_ll_be_visiting');

if (rows && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
var country = row.u_visiting_country; // Ensure this matches your variable name
if (country) {
countryList.push(country);
}
}
}

// Set the hidden variable with the list of countries
g_form.setValue('u_country_summary', countryList.join(', '));

console.log('Country Summary: ' + countryList.join(', '));
return true;
}

@SHUBHAM78 

could you raise this as separate question and share all the details and tag me there as this question doesn't relate to your main question?

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