The SFQueryGen Generator queries a column of data from a Salesforce Object. The query takes place in realtime via a Salesforce REST web service call.
In This Article
- When should the SFQueryGen be used?
- When should the SFQueryGen not be used?
- How does SFQueryGen work?
- Generator Parameters
- Use Case 1 - Query an Account Object for the Account Name
- Use Case 2 - Query an Account Object for the Account ID
- "How to" Video Example
When should the SFQueryGen be used?
- Any time a set of column data needs to be queried from a Salesforce Object and blended with synthetic data.
When should the SFQueryGen not be used?
- Any time data needs to be queried from a source other than a Salesforce Object.
How does SFQueryGen work?
The SFQueryGen Generator does the following:
- Uses a provided Query Statement to query any column of data from a Salesforce Object via REST web services.
- Queried data is cached so that when it is previewed, it does not go out and query the same data again.
- However, when the actual Scenario is run, the data is re-queried during realtime data generation.
This use case shows how the SFQueryGen Generator can be used to query a Salesforce Account Object for the account name.
For this example, an 'accountName' Attribute has been created for the 'Account' Domain.
NOTE: Click here to learn more about creating new Attributes for a Domain.
A Generator will be automatically assigned by the data warehouse when an Attribute is created. In this case, the NameGen Generator was assigned and will need to be replaced with the SFQueryGen Generator.
This can be done by completing the following steps:
- Enter SFQueryGen into the Quick Replacement menu.
- Click the Replace button once finished.
For this example, two Generator parameters have been modified:
- grVar1 = Name
- query = select grVar1 from account order by id
Click Save Generator after making changes to Generator parameters. GenRocket will automatically run the query and return a set of account names.
It caches the first ten rows of the data set that is returned. This provides a set of cached account names that can be previewed with your test data.
NOTE: Clicking Save Generator again will re-run the query.
These Generator parameters have been changed:
- grVar1 = id
The query will be run when Save Generator is clicked. Now, a set of account IDs are queried and cached. From this point on, this set of account IDs can be previewed with your test data.
"How to" Video Example
The "How to" video below also shows the above use case. Please note that this video's user interface is outdated, but the setup, generator parameters, and flow have not changed.