SalesforceLabs / survey-force

86 stars 61 forks source link

How to link survey responses to contacts with surveys filled in inside SF #151

Closed LuciaMCSF closed 1 year ago

LuciaMCSF commented 1 year ago

We have created a very simple survey in Salesforce with Survey Force and we would like to make it accessible for sales agent so that they can fill in the questions on behalf of the clients. IMPORTANT: Clients are person account.

We see we have different options but we do not find the way to link answers to contacts (actually person accounts).

Would you please describe us the process to get this result please? Thanks

jrattanpal commented 1 year ago

I haven't tested it on Person Account but you providing Contact ID should still work. If not then you will have to work on adding support to link survey to account,

Here is an earlier issue where I talk about how you can add objects other than Case or Contact. https://github.com/SalesforceLabs/survey-force/issues/105

LuciaMCSF commented 1 year ago

Hi @jrattanpal before adding the account object, I would like to confirm that I am following the right process.

  1. I have created the survey
  2. I go in the person account page, in the Survey taken related tab
  3. I click new Survey taker and select the survey created at point 1 above. In the field Survey Taken By Contact I select the person account I want to link the survey responses
  4. after saving the new Survey Taken, I click on the survey link (image attached) Survey1.pdf
  5. the survey is opened inside Sf and the only option I see to link the survey with the contact is selecting the sharing option Email link with Contact Merge with Select site Internal
  6. the link that I see is as below: https://companyname--c.visualforce.com/apex/takesurvey?id=a0d6M00000IzNa4QAF&cId={!Contact.Id}&caId=none where it seems I am linking correctly the survey to the contact.
  7. the issue I have comes here as If I click on the Open Survey (new link) I loose the link to the contact. (please note that if I copy and past in the browser the link above and manually copy a ContactId I manage to correctly link responses to the survey)

May I ask you to help me to understand how to manage the last part of the process above? Thanks so much in advance Lucia

jrattanpal commented 1 year ago

You are doing it correctly, except step 7. The link that you see is a "View Only" link. When you click that button, it just gets the link that is already stored (it does NOT take into account that you changed the value) and opens that link.

You will either need to click "Open Survey", get the URL and then make your changes. OR you copy the link (Without clicking "Open Survey") and then make the changes.

You can then use that link from the email option on Contact to send it.

This is all manual process. Although, code to generate that link is there. You can automate it with flow but you will need to make some Apex changes (like creating an InvocableAction that calls code from Survey Force to get the link)

Does this help answer your question?

LuciaMCSF commented 1 year ago

Hi @jrattanpal thanks so much. That's very clear :-) I'm happy to close the case. Have a nice day Lucia