How can I re-size a list collector variable in record producer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 09:59 AM
I have a list collector variable named "supplier". I want to accomplish 2 things...
1) Make the list collector buckets smaller.
2) Have preselected options. I have managed to obtain pre-selected values due to preiously filled variable values, however they are placed on the left bucket, meaning they are not selected.
For point #1 I've used a script (catalog client script) that is referenced several times in the community, however, the community discussions are around 6-8 years ago...this is the script:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function onLoad(){
var varName = 'supplier';
var height = '100'; //Optional 100
var width = '250'; //Optional 250
try{
alert("left bucket exists 7");
//Get the left and right bucket input elements
var leftBucket = $('supplier_select_0');
alert("left bucket exists 10");
var rightBucket = $(varName + '_select_1');
//If the element exists
alert("left bucket exists 13");
if(leftBucket){
alert("left bucket exists");
//Adjust the bucket height (default is 300px)
if(height){
leftBucket.style.height = height + 'px';
rightBucket.style.height = height + 'px';
}
if(width){
//Adjust the bucket width (default is 340px)
leftBucket.style.width = width + 'px';
rightBucket.style.width = width + 'px';
//Fix Fuji/Geneva width issue
//leftBucket.up('.slushbucket').style.width = width*2 + 100 + 'px';
}
//Fix the expanding item preview issue
$(varName + 'recordpreview').up('td').setAttribute('colSpan', '3');
}
}catch(e){}
}
--------------------------------------------------------------------------------------------------------------------------------------------
For point #2 I haven't really tried anything, first of all, I'd like to know if its possible.
THANKS!!!!
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 10:11 AM
Hi Samuel,
one thing you can do is add those variables in 2 column format
also check below links
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019 08:13 AM
Thank you for your response Ankur...the first link you shared is where I got the script from, however, as I mentioned, it is not working for me. I believe the 2nd link shares the same script as well. Those links were created a pretty long time ago...
Also, what do you mean with 2 column format?
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019 08:29 AM
Hi Samuel,
you can arrange the variables in either single column format or 2 column format
https://docs.servicenow.com/bundle/london-it-service-management/page/product/service-catalog-management/concept/c_DefineVariableSetLayout.html
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019 10:45 AM
Ok, I think I understand what you mean...but how does that fix any of my issues? I can't see the relation...
Thanks!