When bulk upsert-ing in Salesforce, we need to use a "fieldName": x.path mapping object. For one of the fields that needs to be upserted, this requires a query to Salesforce:
"fieldName": query(`select Id from Contact where CommCare_ID_c = x.id`
The current query function in language-salesforce adds the result object to the state.references array. For the bulk upsert, we need to be able to access and map the result object directly.
The new directQuery function returns the result object directly, rather than adding in to state.references.
Tested locally.
Please review the PR, and leave any suggestion for tests, function name etc.
When
bulk upsert
-ing in Salesforce, we need to use a"fieldName": x.path
mapping object. For one of the fields that needs to be upserted, this requires aquery
to Salesforce:The current
query
function inlanguage-salesforce
adds theresult
object to thestate.references
array. For the bulk upsert, we need to be able to access and map theresult
object directly.The new
directQuery
function returns theresult
object directly, rather than adding in tostate.references
. Tested locally.Please review the PR, and leave any suggestion for tests, function name etc.
Thanks!