function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Soraya AttiaSoraya Attia 

How to automatically populate the same field inputs across objects e.g. contact to case


Hi, I have the following scenario : a case has been created via web-to-case and the customer has entered their name, Phone and email on the web form.
I created a process via process builder to automatically create a new contact. I tested and it is working, the name, Phone and email fields are correctly populated and the contact record is created.
I am struggling to find how I can automatically map the new contact fields in the case?
 
Best Answer chosen by Soraya Attia
James LoghryJames Loghry
Soraya, 

That's why I'm thinking you need a flow for this.  Reason being is you can't take the Id of the Contact created in your Process and pass it to the Case record update.  Unless you did something a little more complex like creating a custom field on the Contact for the originating case, and then use a process on the contact insert to link the case's contactid to it.

Also, the screenshot you provided is for the process and not a flow.

All Answers

William TranWilliam Tran
I don't understand the question.  The case should already been created with the information filled in from the web form (as you stated :"a case has been created via web-to-case ").

What mappings do you wish to achieve?

Thx
James LoghryJames Loghry
You'll need to create a Flow to handle both the Contact creation and Case Update.  
  1. Create the flow.
  2. In the flow, create an input variable for the case id, phone, and email from the web form.
  3. Create a Record Create element and create the Contact record (use the Phone and Email input variables)
  4. Create a variable to assign the Record Create element's Id result.
  5. Create a Record Update element.  Use the Case Id input variable for the field assignment.
  6. Use the variable stored in Step 4. for the ContactId field on the Case record.
  7. Save and Activate the flow.
  8. Update your process to call the flow instead of performing the related object logic directly in the process.
  9. Save the new process version / Activate the new Process version.
James LoghryJames Loghry
@William Tran, the Web to Case feature will populate the Case's ContactId field if it finds a matching Contact record (by email address), but will not create new Contact records if no match is found.  More info here: https://success.salesforce.com/answers?id=90630000000hvfHAAQ
Soraya AttiaSoraya Attia
Hi James,
Thanks for your response.
I have some questions though on how to create the input variable for case ID on step 2 and then the variable at step 4.

I have added a screenshot of the flow that I have set up for the Contact record creation but I don't know how I can add the variable.
Process Builder Flow
Soraya AttiaSoraya Attia
James, just to let you know that I did not use the Flow in Process Builder. I used Create a Record instead and it is working for the automatic creation of a contact and an account.
Can I use Update a Record for step 2 'Case Update' instead of building a Flow?
 
James LoghryJames Loghry
Soraya, 

That's why I'm thinking you need a flow for this.  Reason being is you can't take the Id of the Contact created in your Process and pass it to the Case record update.  Unless you did something a little more complex like creating a custom field on the Contact for the originating case, and then use a process on the contact insert to link the case's contactid to it.

Also, the screenshot you provided is for the process and not a flow.
This was selected as the best answer
WTM InfoWTM Info

Hi @James Loghry! This Flow is very similar to what I'm needing to do but I have no experience building flows. Could you please provide more detailed instructions on how to create this? You will be a life saver...!