Form mapping using Account ID

Hi all,

We are currently posting form submission data via API from our website to a form handler in Sugar Market.

A completion action then pushes through a nurture with a confirmation email, eventually pushing to CRM.

We have managed to map every lead field to CRM except the account name.

We want to use Account ID to look up the Account Name in our CRM, but unsure how to do this?

Any advice much appreciated.



  • Hi James!

    Our Sugar Market forms does not capture AccountID because we don't use a live lookup via our forms and also for leads there could be a mixture of leads that don't have an account created in the CRM yet or an existing one. So instead, we use the field 'Company' to match against the Account Name.

    So that I can understand the use-case, are these only existing leads that already have an associated Account (and thus an AccountID)? Or does this form capture a mix of new and existing leads?

    Could you elaborate more on the use-case here? If the record completes a form and the record pushes up to your CRM for a new record - how would you determine the AccountID for this record?


  • Hi Michael,

    Thank you for your response.

    We are a global personal training business and have various gym locations across the world which we show on our form.  We use this so they can tell us where they would like to train and direct to the correct sales teams to deal with their enquiry.

    The form is intended for new leads, but there may also be some existing people who enquire again (for a different gym, or will do as it has been a while since they did last).

    In our CRM, all of our gym locations are set up as "Accounts" with an associated ID via a relationship field.



  • Hello,

    It would be good to have a full picture to answer

    It seems in your case Accounts are your company customers - Gyms, while Leads are treated as an interest to the service of your customer, so the same Contact that submits the form via the website could have numerous Leads as representations of their interest (new life full of sport starting this Monday, or another Monday and at another place - two leads from the same person) .
    Perhaps the business is to match interest to Gym capabilities automatically (or in an automatized way) based on Lead and Gym profiles.
    I wonder if you do that in Sugar or proprietary software, and let me explain why I wonder

    In Sugar, if the Lead is created out of the Account context - not via subpanel Leads in Accounts module, - and entered directly with the Company name, it should undergo a "qualification procedure" that is called in the more technical way "lead conversion" in Sugar.

    perhaps, that qualification procedure is "to match Lead to Gyms" for forwarding contact info

    If qualification is performed via the Sugar Sell/Ent user interface, the procedure includes searching for Accounts and relating Leads to Accounts or creating a new Account and relating leads to it. As a part of the procedure, the new Contact could be created, or Lead - as the new interest of the contact - related to it.
    Contact record represents verified contact information that could be used "to contact"
    I wonder if you keep Leads records as a representation of very each Contact's inquiry - as an interest expressed occasion.
    Based on a business decision, Sugar configuration allows to configure both - Leads could be deleted after conversion or remain in CRM as a history of contact interests representations

    But in general, could be there a number of Gyms (your customers) which sales teams would be happy to fight for the Lead, correct?
    If so the Lead should probably be related to a number of Accounts (Gyms) and that is probably the result of the matching algorithm, and I doubt if matching customer profile (Gym) and lead's profile is simplified to only search by Company name specified in the form

    and what is the plan if Leads-to-Gyms automatching fails? Does each of the matching results undergo user revision prior to sending the lead contact info over to your customers (Gyms)?
    that could be a kind of user interface for your staff to complete qualifications, maybe ask additional questions, and then refer a lead to the correct Gym(s) (Accounts).
    perhaps the OOTB Lead conversion interface could be of use for that manual relation

    Despite of numerous questions - if the purpose is just to build an automated lead conversion procedure that includes assigning leads (that are kept in Sugar) to the Accounts with the criterion of matching the declared Company name from the form with the Account name in CRM,
    a possible solution could be configuring a logic hook in Sugar Sell/Ent, so that e.g. the very moment Lead undergoes conversion procedure (on lead is created in SugarCRM Sell/Enterprise via Market integration, or when does it happen according to your business model?), to look up through Accounts in Sell/Ent searching the given in form Company name and if the Account(s) are found to relate Lead to Gyms automatically

    Best Regards,
    Dmytro Chupylka
    We make work in Sugar CRM system faster, more convenient and efficient

  • Thank you so much for the details and also for those details. That absolutely makes sense.

    I checked your account and website to get a little better understanding and believe I have a fuller picture here. Your enquiries page has a drop down list for Location, those are tied to a custom field in Sugar Market and linked in your CRM called Accounts_Leads_1_name. 

    I see as well that you have a custom field mapped on the Sugar Market form to the custom field account_id but this field is hidden from the user and no data is being captured here.

    If the goal is to link these leads or existing contacts to an account (gym location), and because you have a limited number of Accounts, I would suggest either of the following:

    1. The client is already selecting the location from the dynamic drop down menu on the website, map this field to 'company' in Sugar Market with the exact name and spelling for the value as they are called in your CRM. This will match that record to the account.

    So for example, if they select Region = US, Location = Bethesda / USA - have the 'Location' field map to 'company' field instead of Accounts_Leads_1_name and make sure the 'return value' of the Bethesda Account is spelled exactly how it is in your CRM. Everything will match up.

    Now, I'm unsure of the importance of this custom field but if it needs to be added as well, there are logic/workflows that can be done on the API script side or even in SugarCRM perhaps.

    2. A similar concept to the first option as above - when the customer selects their Location, either replace or do an addition to of inserting the account_id field to the proper account id based off their selection.

    Example, client selects Bethesda / USA again. Since this Account has a specific ID, you may choose to map this field directly to account_id. Making sure that each account/location selection for the 'display value' has the proper account id for the 'return value'. Then Sugar Market will simply push this over to the CRM. 

    Now, doing this method Sugar Market will not link the lead/contact record to an Account on it's own like it would in option 1 since we're using custom fields. But I believe the use-case you're presenting here is to utilize the AccountID instead.

    While the first option aligns more with how Sugar Market operates as it will auto link those records to the account, either option should still be good. 

    If you're wanting to keep all those custom fields like accounts_lead_1_name but want to do an additional field to capture the Account info (either option 1 or 2) then that would need to be done on the API side. When a custom selects the location, it passes a hidden field of the AccountID to the account_id field based off of that selection. 

    I hope this helps!


    Michael North

    Sr. Manager, Technical Support