0

Is it possible to match against multiple values after the comparison operator?

I'm trying to filter against a title field where there could be a handful of correct titles, but I can't get it to work. Should I be wrapping in else if logic, you think?

for example:

set @records = retrievesalesforceobjects("User", "Name", "Title", "=", "Sr, Jr, Lead, Dev")

The records could be any of those, but I'm not retrieving any records when using all at once - only if I match against one of the records.

Is there an elegant way to pull in each of those titles for the respective records?

1 Answer 1

1

Unfortunately you can only match one value per field and there is no OR clause available for use when you add additional fields to match on, so you’d have to use a separate retrieve call for each of the possible titles you want to match on and then use if/else statements to sort through the results.

Additional API field name, comparison operator and value sets can be appended as arguments. However the function joins these additional sets using and clauses.

Source: https://ampscript.guide/retrievesalesforceobjects/

1
  • thank you, I got it to work by using IF statements. wish they would make it easier to add OR conditions in the future. thanks!
    – Heavy2
    Mar 10 at 2:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .