Flow: User Input to Update Info on Contact

Prompt

Flow Lab Inc. needs to keep their contact info up to date. When a user is on the phone with a customer, they go to their contact page. Prompt the user to update the customer’s email address and phone number.

On 3/31/21, added a “Lookup” element to the screen to explore how those work.

Using Lookups in Flows

The following fields are required when creating a Lookup in a Flow:

  • API Name: API name of the object being looked up. In this example, Account.
  • Field API Name: Generally the ID field of the object being looked up.
  • Label: Label that will be shown in the Flow.
  • Object API Name: Object being looked up from. In this example, Contact.
  • Record Id: The field on the current record that this field in the flow will be populated with.

Solution

Build Flow

  1. Resource > Variable
  • Record_Id Text, Available for input
  1. Data > Get Records
  • Id Equals Record_Id
  1. Interaction > Screen
  • Email Input
    • Value: {!Get_Current_Record.Email}
  • Phone Input
    • Value: {!Get_Current_Record.Phone}
  • Lookup
    • API Name: Account_Lookup
    • Field API Name: AccountId
    • Label: Account Name
    • Object API Name: Contact
    • Record Id: {!Get_Current_Record.AccountId}
  • Control Navigation: Next or Finish Only
  1. Logic > Assignment
  • {!Get_Current_Record.Email} = {!New_Email.value}
  • {!Get_Current_Record.Phone} = {!New_Phone.value}
  • {!Get_Current_Record.AccountId} = {!Account.recordId}
  1. Data > Update Records
  • Use the IDs and all field values from a record or record collection
  • Record to update: {!Get_Current_Record}

Deploy Flow

  1. Contact Record Page > Edit Page > Add “Flow” element to page from Lightning App Builder
  • Check the checkbox: “Pass record ID into this variable” -> Record_Id