Vlocity Facts #28|| How to use QUERY() function in DataRaptors, Set Values with static and dynamic values
We can use SOQL in QUERY() function to fetch the details in DataRaptors or Set Values.
1. Static Value -- We can write query on recordtype by using formula tab in DataRaptor.
In the above screenshot by using Query function I'm getting recordtype id from Formula Result Path we can use that for mapping in out put tab.2. Dynamic Value -- For example we need to pass any values to the query which we are getting from other actions or based on other record then we can follow this approach.
Here I'm passing Account Id, Priority to get related case numbers of the account.QUERY("SELECT CaseNumber FROM Case WHERE Priority = '{0}'AND AccountId = '{1}'
LIMIT 3", Priority, Case:AccountId)
Priority = '{0}' -- This holds the Account Priority in our case it holds 'Medium'
AccountId = '{1}'-- This holds the accountId
{0}, {1} holds the values of what we are mentioning after query in our example --
Priority, Case:AccountId
condition.
QUERY("SELECT CaseNumber FROM Case WHERE ClosedDate = {0} AND AccountId = '{1}'
LIMIT 1", Date, Case:AccountId)
Comments
Post a Comment