How to add custom field values to contact


(John Borelli) #21

I would have obfuscated the access and refresh token values but that is exactly the information you need to get back. Now verify that the information you posted is also getting updated to the database correctly and then verify that you have a good read as well. When you’re refreshing tokens on a cron job, you really don’t need to use sessions. Up to you but it’s just one more component to deal with.


(Vinod Rath) #22

Hi @John_Borelli
I have one more question. How can i post field autoCharge to No. I have do manual payment with api call. please let me know. Found autoCharge is bollean so please let me know its values.


(John Borelli) #23

On the RecurringOrder table the AutoCharge field is an integer that can be set to 0 for no and 1 for yes


(Vinod Rath) #24

Is this related to JOb ID ?


(John Borelli) #25

You can’t autocharge a job. Only a payment. Also job’s aren’t chargeable. Only invoices are.


(Vinod Rath) #26

Understood. I have seen there contactId field so i will fire an update query. Thanks


(Vinod Rath) #27

hi @John_Borelli,
Is there any way to check values using custom fields. I have tried this earlier but that not worked. Can you suggest more on this.


(Mike Christianson) #28

@Vinod_Rath I would recommend using the REST API to work with custom fields for Contacts.

Use GET /contactCustomFields to view the custom fields that you have configured.
Use PATCH /contacts/{contactId} to update a Contact with values for the custom fields you want.

The body of the PATCH /contacts/{contactId} request might be something like:

"custom_fields": [
 {
  "id": 2,
  "content": "B0018ZW7CA"
 },
 {
  "id": 0,
  "content": "2017-04-28T14:33:00-0700"
 }
]

How to add Custom field record in infusionsoft?
(John Borelli) #29

@mike.christianson is using the REST approach which is perfectly fine. But that’s not your only option. Using both the current api and previous (legacy) isdk, you can include custom fields in your return fields on a query. Two things to remember:

One, they must follow the database naming not necessarily what you name them. This means that if you name a field thisField and then delete it and recreate it then you will need to use thisField0 instead. You can find this out by going to admin->settings and then click go for your custom fields on contacts…then click view database names. Second, precede the fields in your return fields array with an underscore. That is how IS knows to look in the DataFormField table (which is where your custom fields are stored).

Hope that helps to clarify.


(Vinod Rath) #30

ji @John_Borelli,
I am try to check duplicated records by checking custom fields that already stored on Infiusionsoft. Please suggest more on this. see below
$infusionsoft->data->findByField using custom fields.


(John Borelli) #31

Ok, so you’re using the current api with findByField. As mentioned above, you’ll want to be certain that you are looking for the database name of the custom field. So, as an example, lets say that name is CustField0. In addition to your standard return fields, you would want to add CustField0 to your return field list. So if you are getting first and last name, email and phone along with the custom field, your return field array might look something like this:

$rFields=array(‘FirstName’,‘LastName’,‘Email’,‘Phone1’,’_CustField0’);

And your call would pass them in as follows:

$data=$infusionsoft->data()->findByField(‘Contact’, 1000, 0, ‘CustField0’, '’, $rFields);


(Vinod Rath) #32

ok i have tried that using _custfield earlier so thats not working. I will check without underscore and let you know.


(John Borelli) #33

You need the underscore. If it’s not working then you probably don’t have the database name for the field.


(Vinod Rath) #34

$data=$infusionsoft->data()->findByField(‘Contact’, 1000, 0, ‘CustField0’, ‘’, $rFields); this works?

$data=$infusionsoft->data()->findByField(‘Contact’, 1000, 0, ‘_CustField0’, ‘’, $rFields); this not right ?


(John Borelli) #35

Are you saying without the underscore works or are you asking a question?


(Vinod Rath) #36

with underscore worked. Thanks


(Vinod Rath) #37

hi @John_Borelli,
How can i set AutoCharge to no. I have create blank order and add manual payment and autoChanrge is automatic set to yes. Can you help me on that. This field is found in RecurringOrder table but i do not process any RecurringOrder when i import contacts. please suggest more on this.


(John Borelli) #38

@Vinod_Rath,

AutoCharge is an integer boolean value. So to set it to ‘no’ you must assign it the value 0. However if you are not setting up subscriptions (RecurringOrder) then this value would have no meaning (which would be why it’s only settable on the recurring order table). So the question is, if it’s just a one time, non recurring payment, is there a compelling reason to be concerned about it being set to no?


(Vinod Rath) #39

How can i achive this ?

  1. create blank order
  2. add manual payment
  3. need to set AutoCharge to No

Can suggest more on above point?


(Vinod Rath) #40

@John_Borelli I think need to use find field by table and update autoCharge to no. Can you let me know how can i found that autoCharge record in which table? so i can update that field to zero.