The SFPIckListGen Generator queries an object description for a given field name, and if its Type is equal to picklist, it will read the picklist Values as its set of values to generate. 

In This Article

When should SFPickListGen be used?

  • Any time picklist values need to be queried by a field name in the Salesforce Object description and blended with synthetic test data.

When should SFPickListGen not be used?

  • Any time data needs to be queried from other sources (e.g., files, databases).

How does the SFPickListGen work?

  1. Queries the picklist data from a Salesforce Object field name via REST web services.
  2. Queried picklist data is cached for previewing in the GenRocket web platform. 
  3. The picklist data is queried live during realtime test data generation when the Scenario is run.

Importing Salesforce Objects into a Project

  • When Salesforce Objects are imported into a given Project and Project Version, GenRocket will automatically assign the SFPickListGen Generator to any fields of type 'picklist.'

  • Click here to learn more about importing Salesforce Objects into a Project. 

Generator Parameters 

The following parameters may be configured for the SFPickListGen Generator. Items with an asterisk* are required. 

  • serviceVersion* - Define the service URL version number. For example, 34.0.
  • objectName* - Defines the name of the object to query. 
  • fieldName* - Defines the field name to query for within the object description retrieved. 
  • setLoop* - Defines whether the size of the list should be used to set the Scenario loop value. 
  • waitAmount* - Defines the number of iterations the Generator should wait before moving to the next value in the list. 
  • random* - If 'true,' the list is randomized. 
  • seed - Defines an optional seed to allow the same random set of values to be generated.
  • list -Caches the values of the Salesforce picklist. This way, the picklist data is only retrieved via Salesforce REST web services when an Attribute with a picklist is first created or when a user clicks the Save Generator button on an Attribute using the SFPickListGen.

Use Case 1 - Query Salesforce Account Object by Type Field

This use case shows how to query a Type field in an Account Object using the SFPickListGen Generator.

Step 1 - Create a Project with a Domain

For this example, a Project titled 'SalesforceDemo' has been created with the default Project Version and an 'Account' Domain.  

NOTE: Click here to learn about creating Projects. Click here to learn about creating/importing Domains into GenRocket.

Step 2 - Create an Attribute for Querying the Salesforce Object

For this example, a 'type' Attribute has been created for the 'Account' Domain. 

NOTE: Click here to learn more about creating new Attributes for a Domain. 

Step 3 - Assign the SFPickListGen Generator to the Attribute

A Generator will be automatically assigned by the data warehouse when an Attribute is created. In this case, the EvalCaseSentenceCSVGen Generator was assigned and will need to be replaced with the SFPickListGen Generator. 

This can be done by completing the following steps: 

  • Enter SFPickListGen into the Quick Replacement menu.

  • Click the Replace button once finished.

Step 4 - Configure the SFPickListGen Generator Parameters

For this example, two Generator parameters have been modified: 

  • objectName = Account
  • fieldName = Type

Step 5 - Save the Generator Changes

Click Save Generator after making changes to Generator parameters. 

GenRocket will automatically run the query, and the picklist data will be retrieved. This data can be seen in the list Parameter and the Preview window. 

NOTE: Clicking Save Generator again will re-run the query.

"How it Works" Video Example

The "How it Works" video below also covers the same use case discussed in this article. Please note that this video's user interface needs to be updated, but the setup, generator parameters, and flow have stayed the same.