cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Pass a pipeline parameter to a SOQL

wani-amol
New Contributor III

Is there a way to pass a pipeline parameter to a child pipeline which has a SOQL, and use that parameter in the SOQL?
I am trying to output a date field from a parent pipeline and pass it into the SOQL which is a part of the child pipeline?
Appreciate your help. Thanks!

5 REPLIES 5

aleung
Contributor III

Here is sample of how to pass parameter to Salesforce SOQL snap. Unsure about your specific use case but likely you might not need to introduce a sub-pipeline.

Hope this help.

SFDC_User_Role_2019_03_16.slp (6.6 KB)

wani-amol
New Contributor III

Thanks for your quick reply! How do i import/view the pipeline attached in your reply?
A bit more information on my usecase:
On a higher level, I am trying to compare a datetime within Salesforce Account object and a sql server database.
I am trying to compare the LastModifiedDate in Salesforce to the last time the pipeline ran in order to get the updated records within the last time-block.
Since I want visibility over my pipeline, I have a created a SQL Server database and I write a timestamp in it every time my parent pipeline runs. I want to pass that timestamp from my parent pipeline to my child pipeline. The child pipeline has a SOQL snap using which I am trying to compare both timestamps and get specific records.

To view his pipeline, you would need to download it from here and import it into your environment, preferably in a test area.


Diane Miller
Community Manager

wani-amol
New Contributor III

Got the import option. The query still seems to give me an error. The SOQL query I am using is below:
โ€œSELECT Id ,IsDeleted ,MasterRecordId ,Name ,Type ,RecordTypeId ,ParentId ,BillingStreet ,BillingCity ,BillingState ,BillingPostalCode ,BillingCountry FROM Account WHERE LastModifiedDate >โ€ +$StartTime

and I am passing the StartTime as a string in the required format.
eg. 2019-03-15T19:15:13.067

It gives me a 400 error.

Reason: {โ€˜statusCodeโ€™=โ€˜400โ€™, โ€˜messageโ€™=โ€˜The request could not be understood, usually because the JSON or XML body contains an error.โ€™, โ€˜responseโ€™=โ€˜[{โ€œmessageโ€:โ€œline 1:0 no viable alternative at character โ€˜"โ€™โ€,โ€œerrorCodeโ€:โ€œMALFORMED_QUERYโ€}]โ€™},