What is the tableName and field to filter contacts by Lead Status


(Yehia Mahmoud) #1

i have been able to get the contacts of a specific tag (group) using xmlRPC query on a table ContactGroupAssign.
i would like to know what is the field name and table name of Lead Status of a contact as shown:

also how can i get data from more than one table simultaneously .
i want to get some contacts data from table contact , appointments from ContactAction and the table contains Lead Status
and filter those data by tags with Lead Status value.

suppose i have about 100k contacts.


(Pav) #2

That Lead Status is a Custom field added to your Contact Record.

You can get the list of the Contact Custom Fields by going here “Admin - Settings - Application Settings - General - Custom Fields”.

Otherwise, you can query the API “DataFormField” table for this. Make sure the FormId is “-1”.
https://developer.infusionsoft.com/docs/table-schema/#DataFormField

API Table searching is for individual tables. You will have to do several queries for this to work.

What you can do is to do a query say on the “Contact” table first, and collect the Contact IDs.
Then you pass an array of the Contact ID numbers into the Data Query parameter for the ContactAction table.

$contact_ids = array(1,3,5,6,7);
....(QUERY)... array("ContactAction", 1000, 0, array("ContactId" => $contact_ids), array("Id", "ActionDescription"))

If you have 100k Contacts, then you will only need 200 API Calls here.