We're working with the Salesforce connector, trying to gather family information from respondents. Currently the form asks for the submitter's information, their spouse's information, and as a repeated section, their children's information. Each family member should be a contact in Salesforce. It appears that once I link the submitter's information to a Contact object in SF, there is no way to state that I'd like to create a second Contact and direct spouse information to that second contact. Using the repeated section creates new Contacts for the second and greater children, but the first child's information is appended to the submitter's information.
It looks like I'll have to use a workflow to break up the form into sections based on when Contacts need to be created. Is there a better alternative? Thanks!
What kind of SF object is the first child when it is appended to the submitter's contact record? My guess is that it is inheriting the contact ID somehow and creating a dependent object rather than a contact.
Sorry, I thought you were saying that the spouse and children were appended as different object types to the submitter's contact record.
I am having a little trouble visualizing the structure, but let me see if I have it right. You want to create unique contact records for each person (the submitter, their spouse, and each child), but are having a hard time getting FA to create separate contact records?
If this is the case, you should be able to accomplish this fairly easily. From your description above, it seems you are trying to link the contacts to one another. I would recommend creating a new account for each set of contacts (the account would represent a family) and have them all related by being part of the same account. So it would go something like this:
1. Use a combination of static and user-created data to create a new account, e.g. "The Johnsons" 2. Set up your SF connector create a new contact record for the submitter, spouse, and children. Be sure to pass along the Account ID as the parent ID in each of the contact records. This is how they will all be linked. 3. Add a custom field to your contact record to signify their relationship in the account/family, such as "spouse" or "child." Set a static field in the SF connector to mark the records appropriately so you can tell who is who.
Right on, right on. That's pretty much the Salesforce layout I have going on. The trick is step 2. How can I set up a connector to create three different Contact objects (at least), with one needing additional data (the submitter)... I've got it structured in a workflow but it's much more complex and save/restore doesn't work as one would hope, so building it into a single form would be way better. But I think there's no way to create more than one instance of a particular object on each form.
Here's another doosey--with the workflow solution, the "children" form is a mess because not everyone has children. I can't skip workflow steps. Repeated sections can't have zero items. I can hide the section completely but if I've got Contact mapped in the SF Connector, at least one Contact is guaranteed to be created by that form. And Contact requires a last name. In other words, _something_ must be entered into the repeating section. Here's the solution we ended up with:
Step 1 gathers the submitter's information and creates a Contact and Account. Step 1 leads to Step 2, passing the entered submitter information, the created Contact ID, and the Account ID. Step 2 has two questions, are you married and do you have kids. If you answered yes to either, a repeated section is shown with fields for additional Contacts. A hidden field is also included in the repeating section. The submitter's information from Step 1 is loaded into the first repeat section, and the submitter's Contact ID is loaded into the hidden field. The hidden field is marked as an upsert so the first section simply updates the Contact created in Step 1 with the same information. Some javascript is prepended that makes the first section read-only. Users can add additional sections to add a spouse or kids, or if they said they have none, the submitter's Contact just gets updated as before.
This works, but man, what a complicated mess of passing IDs and information around. This could all be avoided if there were a way to build it into one form.
My proposal is this: Currently the order in the SF Connector is critical. Accounts are created before Contacts if they're listed first. Create a new "mapping type" that is "New object" or something. Every mapped field below that will link to the second created instance of any objects that came before it.
I know this makes a mess of things like %%SFA_CONTACT%%. Not sure what to do there, but I have complete faith you guys could figure out something really useful... ;)
I think I might have a workaround that is a bit more elegant. The easiest way to add multiple instances of an object is to have them be repeated dependent objects of a parent object (i.e. creating multiple contacts under an account). Here is what I would suggest:
1. Set up a new form that will create a new Account record upon submission. 2. Here is of course where things get tricky, but I think FA will allow you to do this fairly easily using its logic capabilities. Set up a SINGLE repeatable section that collects Contact information. Design it so that there are three "Contact types" to pick from - Primary, Spouse, and Child. The contact type should default to Primary, so that the submitter enters his or her information first. Add logic so that when a Contact type of Primary is selected, it shows a subsection that gathers the additional information required from the primary contact. Change the "Add another response" link text to something like "Add a spouse or child." Now when the submitter needs to add another contact, he will have to choose what kind of contact it is (which helps you get around the issue of people who have a spouse but no children or children but no spouse). 3. Set up your connector to pass the Account ID to each of the repeatable sections, which will create a new instance of each Contact under your new Account.
For a really basic version of the form I described above, check out this form:
Hmmmm... Yup, seems like that could work. I hadn't thought about having a drop-down to choose which fields get populated. Both this and my original implementation are still a little clunky from a user interface standpoint, but your solution will at least clean up the back-end signficantly.
Thanks j. I appreciate the attention you've paid to my question.
Always happy to help! I figure the more that users like us can help one another out, the more time the folks who actually develop the product will have to do just that. Feel free to email me if you run into any other issues. I can be reached at jlabau (at) rebuildresources (dotcom).
Once you get your form up and going, send me a link to it. I might have some other thoughts on how to use FA's out-of-the-box features to spruce up the UI a bit.