Adding default item to List Collector choices

Jeff Shaevel
Tera Contributor

I have a catalog item in Madrid where someone can multi-select Departments from that table into a list collector. Since I have the Department of the Requester in another field already, I'd like that to already appear selected in that list. The display in Madrid isn't the two-bucket system, but a line of choices with "x" to remove. I've looked through forums and I can't get anything referencing the buckets to work, nor do I see anything in the documentation. If, for example, using my personal instance as a guide I wanted "HR" to show pre-populated as a selection in that list collector, what is the appropriate way to do this? Thank you.

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hello,

How is that department getting in to that other field already? I assume since it's a catalog item, it's through an onChange client script that is using glideajax? Or are you using default value on department with that?

If it's loading through a script to display in that field...in the same setValue section...just also setValue the list collector field with it. If it's through default value, repeat same for this field.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

8 REPLIES 8

Allen Andreas
Administrator
Administrator

Hello,

How is that department getting in to that other field already? I assume since it's a catalog item, it's through an onChange client script that is using glideajax? Or are you using default value on department with that?

If it's loading through a script to display in that field...in the same setValue section...just also setValue the list collector field with it. If it's through default value, repeat same for this field.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Jeff Shaevel
Tera Contributor

There was a complication with the variable set which was making this appear as if it wasn't working. The solution above (which was my actual first approach) works fine. 🙂

Which may point to another issue. The variable driving this is in a variable set. I created an OnChange script ON THE CATALOG ITEM (not the variable set) to fire when the field in the variable set changes. This is necessary since the list collector is on the item, not the variable set. However, the catalog client script doesn't appear to fire. I've put "addInfoMessage" on all the scripts and the OnChange isn't firing.

I proved the solution above worked by adding the list collector to the variable set and doing the assignment in the variable set client script. Is there some magic to getting the OnChange for the item to trigger from a variable set variable?

Hi. I do onChanges from variable set items ON the catalog item all the time. Are you sure you chose the variable set field? which looks sort of weird like field name >>>> field name  (something like that).


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Yes, but apparently I had UI type set to "Desktop" and it didn't like it until I set it to "All" even though I was working on desktop. All is fine now. Thanks so much for the help.