Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating custom fields for a lead #30

Closed
aliw77 opened this issue Aug 28, 2016 · 2 comments
Closed

updating custom fields for a lead #30

aliw77 opened this issue Aug 28, 2016 · 2 comments

Comments

@aliw77
Copy link

aliw77 commented Aug 28, 2016

Taylor - thank you for creating this very helpful gem and opensourcing it. I had a question about updating custom fields for an existing field, and creating a lead with custom fields. I have tried the following and it didn't work:

puts client.update_lead(lead.id, '{"custom.XXX": "Yes"}')
I see a Hashie::Mash object returned which is the lead but the custom field does not seem to be updating. I tried it without the single quotes, as a JSON but same results, no update to the custom field and same Hashie::Mash object returned

Any thoughts on how to do this?

Also, is there a way to create custom fields during lead creation?

thanks again!

@taylorbrooks
Copy link
Owner

Try doing:

client.update_lead(lead.id, 'custom.field name' => "field value")

You should be able to create leads by doing something like:

client.create_lead(
    name: "Bluth Company",
    contacts: [{
      name: "Buster Bluth",
      emails: [{type: "office", email: "cartographer@bluthcompany.com"}]
    }],
   custom: {
     "Custom Car Type" => "Stair Car",
     car_color: "red, white and blue"
   }
)

Make sense?

@aliw77
Copy link
Author

aliw77 commented Aug 30, 2016

works like a charm! thanks.

@aliw77 aliw77 closed this as completed Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants