Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
The statement below loads Contacts where the ContactID already exists AND where the Inactive_contact__c field is FALSE.
How can I amend it so that I load Contacts where the ContactID already exists OR where the Inactive_contact__c field is FALSE?
Contacts:
LOAD Id as ContactId,
AccountId,
Email,
Phone,
Inactive_Contact__c,
Name
WHERE EXISTS(ContactId,Id);
SQL SELECT *
FROM Contact
WHERE AccountId != NULL AND Inactive_Contact__c=FALSE;
How about something like this ?
Contacts:
LOAD Id as ContactId,
AccountId,
Email,
Phone,
Inactive_Contact__c,
Name
WHERE EXISTS(ContactId,Id)
or Inactive_Contact__c = 'FALSE';
SQL SELECT *
FROM Contact
WHERE AccountId != NULL AND Inactive_Contact__c=FALSE;
Remove the Inactive_contact_id test from the SQL query and instead test in the load section for where exists(..) OR Inactive_contact_id = 'false'.
Note I've put the false in quotes. It looks luke your querying Salesforce and I think it passes false as a string literal. But may need to check.
Thanks Bill. I tried this and also removed the Inactive_Contact__c=FALSE from the SQL SELECT statement.
However, the results only brought back records that met the WHERE EXISTS clause. The OR part seems to have been ignored.
Thanks Michael. Yes, I am querying Salesforce. Good spot!
As i said in my reply to Bill, the OR part seems to have been ignored. As the number of records returned is exactly the same as if it wasn't there. There should be a big increase in the records returned
Would this work
where exists (contact)
then concatenate
where not exists (Contact) and inactive = false
Although I'm sure there is a better way
Hi,
Try below code:
Contacts:
LOAD *;
SQL SELECT *
FROM Contact
WHERE AccountId != NULL;
NoConcatenate
Contact:
LOAD Id as ContactId,
AccountId,
Email,
Phone,
Inactive_Contact__c,
Name
Resident Contacts
WHERE EXISTS(ContactId,Id);
Concatenate
LOAD Id as ContactId,
AccountId,
Email,
Phone,
Inactive_Contact__c,
Name
Resident Contacts
WHERE Inactive_Contact__c= 'FALSE';
Regards
Neetha
Hi,
you could try comparing Inactive_Contact__c to the result of False() function, that is:
WHERE EXISTS(ContactId,Id) and Inactive_Contact__c=false()
;
Regards,
Anna
Did you find a solution?