Snowfakery
Snowfakery copied to clipboard
Allow for multiple combinations of selections (multi-select picklist)
Description
Add in the ability to allow for multiple selections in order to work with multi-select picklists or similar database functionality. Currently, random_choice
only allows for one individual selection at a time. Multi-select picklists can have multiple selections.
@prescod gave the example of DNA and proposed a new random_choices
function:
DNA:
random_choices:
min: 0
max: 5_000_000
with_replacement: True
choices:
- A
- C
- G
- T
Above Potential Solution Description
-
min
would be the minimum number of potential values returned which could be 0 (null). If no min is specified then1
is assumed. -
max
would be the maximum number of potential values returned which could be any number. If no max is specified then the number of choices is assumed to be the max. The above example would default to4
.
In the above-proposed solution acceptable possible results would be:
- "ACT"
- "CGT"
- "AT"
- "AAAACCCGGTAACGT
- ""
- "G"
Additional info for Salesforce Internal Users is available here: https://salesforce-internal.slack.com/archives/C01KBFT16Q2/p1614027103002800
@prescod Would you mind looking over this issue? Not sure if I captured everything you were thinking correctly. Also, couldn't remember what with_replacement
meant.
@Julian88Tex What is the best SFDO product to install to experiment with multi-select picklists? Or is there a standard object field I could use?
@prescod I know of an SFDO-ish product from Salesforce Impact Labs project. I have this branch which I was working on a Snowfakery yml which includes this multiselect picklist fied.
I ran into this when trying to populate EDA's hed__Race__c field, a multi-select picklist. As people can have more than one race, it would be great if Snowfakery could select more than one option. Right now, I'm just doing:
hed__Race__c:
random_choice:
choices:
- American Indian/Alaskan Native
- Asian
- Black/African American
- Native Hawaiian/Other Pacific Islander
- White
- NULL
Using the proposal above, something like this would work:
hms_Race__c:
random_choice:
min: 0
max: 5
with_replacement: True
choices:
- American Indian/Alaskan Native
- Asian
- Black/African American
- Native Hawaiian/Other Pacific Islander
- White
I'd also love to use this for the Race MSP.