Posted: September 22, 2017 at 11:26 pm
September 22, 2017 at 11:26 pm Hi, We are using EE4, and I’ve tried editing the code to map a custom question for “company” in the registration form so that it updates the Company field in Infusionsoft. I’ve followed the instructions on the article However it’s a bit vague in regards to whether the text “custom-question” through out the code needs to be edited. And the greyed out instructions seem to say the same thing twice – which is a bit confusing, ie “get the last answer this attendee provided to the question with admin” Here is the sample code you’ve provided that I’ve edited, can you tell me which part I’ve missed editing to make this work.
Thanks, Mike
|
|
Hi Mike, There are actually examples for two different fields in the code example, hence the repetition. Here’s a link to some sample code that shows only one field, and includes more inline instruction about what to change: https://gist.github.com/joshfeck/07d2c6598f33043b67e5b9f4f8645f3b |
|
September 25, 2017 at 11:33 pm Hi, I’ve followed the directions in the new code and tested and still the company field is not being pulled through into Infusionsoft. The code is as follows, and the instructions require to change only two items, which I’ve done. Can you please let me know what is incorrect in the code, as it should work based on the code provided. “//* Please do NOT include the opening php tag, except of course if you’re starting with a blank file /* Stop Adding Functions */ |
|
September 26, 2017 at 10:37 am Hi Mike, Before we try determine whether your code is correct or not, let’s first make sure it’s loading and executing at the right moment. If the code loads too late that will just not do. May I ask is the code within a theme’s functions.php file or is it within a custom functions plugin. If the latter, is the plugin set to Activated on the WP > Plugins page? |
|
Hi, I have this in my own custom plugin, which is active in my list of plugins for the site. Here is an event page, where I have a 0 dollar event setup, that you can test. This should be sending through the company details to Infusionsoft. http://events.getbusiness.fit/?espresso_events=getting-better-clients-quicker Happy to give you access to the site if you need to check that way. Just really need to get this sorted so I can start marketing the event. Thanks, Mike |
|
Testing the registrations isn’t going to help me find if there’s anything in the code that needs to be adjusted. The two items that we need to verify are 2) The field from Infusionsoft’s end. Are you certain you should be trying to pass the company name to a custom field? There’s a standard field for that and you’re likely going to map to the standard field, so your line 20 from the code will be |
|
Hi, The custom question label in EE is “company”, which is what I have in my code, as per the instructions. With item two you can see that what you have in your code is exactly the same as my code, so not sure why you are asking that. My line 20 your line 20 Please advise what the issue is, as I can’t see anything that is wrong. Thanks, Mike |
|
In your code you have: ‘Company’ and ‘company’ are not the same, your code uses ‘Company’, so is your question label capitalized? If not change your code to match it exactly. |
|
Hi, Ok, so I checked and the admin label in EE is ‘company” with a small “c”, and so I changed the code in my plugin to now be “// change custom_question on the next line to match the admin label in EE > Registration Forms > Questions I tested and still not coming through. What is next to test to make this happen? Thanks, Mike |
|
Ok, in IS what did you add the custom field to? Contact? Any custom field from InfusionSoft needs to be prefixed with an underscore and you need to use the database name for the field which may not be the same as the field name, for example take a look here – http://take.ms/qeBtHt That’s the custom fields for Contacts on my account, note that ‘Company’ is listed there, but if I click the ‘View the field database names (for the API)’ link on that page I see – http://take.ms/0JysB Meaning for that field I need to use Also when testing are you testing new contacts or existing contacts? |
|
Hi Mike,
It’s not exactly the same Mike. Do you see that one has an underscore and the other doesn’t. This is a difference and it’s an important one. Are you using a custom field for company in IS or a standard field? This is an important distinction. If it’s a standard field, you don’t use an underscore: If it’s a custom field you do use an underscore:
|
|
Hi Josh, Thanks, I took out the underscore and it seems to be working, wahoo!! If I want to push through another standard field in Infusionsoft, like Job Title, is it just a matter of copy the code, and inserting it at the end, ie before the else statement, or when you are pushing through multiple custom questions is the code different? “//get the last answer this attendee provided to the question with admin label ‘custom_question’ Thanks, Mike |
|
The code you add will be slightly different because you’ll need to make sure you add unique variables that push new unique keys to the array of data that’s sent to IS. The example code in the documentation actually has two fields being passed to infusionsoft (the first one is a standard field, the second one is a custom field). You can send two standard fields in the same manner though. |
|
The support post ‘Mapping Custom Questions to Infusionsoft’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.