DDP Form Checkbox Responses within SOQL WHERE IN clause


I am using a DDP Form step as a filter for my DDP.  One of the Form Fields is a Checkbox where the user can select 1 to many values as a filter.  I then (want to) pass in the user's selections as a parameter into the WHERE clause of my SOQL query.  This works fine if only 1 response is selected, but if more are selected, the SOQL's WHERE IN clause expects each response to be single quoted and comma separated.  Is there anyway to properly format the string to place single quotes around each response and as well as comma separated between each response?  Or another method to achieve this requirement of selecting 1 to many values and using that in a the SOQL?

 

Thanks in Advance.


2 replies

Userlevel 4
Badge +8

Hey Joseph Corrado‌,

You might be able to split your single checkbox field into multiple checkbox form fields then filter your SOQL query that way. This is an interesting use case for forms and SOQL queries though, I'd recommend submitting a feature request on uservoice.

Cheers,

Ryan

Userlevel 4
Badge +8

‌,

I spoke to a couple other people on my side and they suggested doing a 'Run at the Beginning' Insert Update and push your checkbox values into a Salesforce field then create a Salesforce formula field to reformat the data. You can then filter your SOQL query on the newly create formula field.

I hope this helps.

Cheers,

Ryan

Reply