What is the proper output of a picklist source snippet?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I'm trying to create a picklist of the last 5 years and the next 5 years for a UI-only picklist field. What's the proper output/return value? Or am I rendering directly in the snippet? I can't find documentation anywhere.

Thanks,
Seth
Photo of Seth Leonard

Seth Leonard

  • 662 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
You'll need to return an object from the snippet with specific properties. You can look at this documentation to see the format of the picklist object. Here's an example snippet:

var params = arguments[0],	$ = skuid.$;
var entries = [];
entries.push(
   { value: 'Working', label: 'Working', defaultValue: false  },
   { value: 'Submitted', label: 'Submitted', defaultValue: false }
);
return entries;