You are here:
Best Practice: Launch a Screen Flow from a Maps Custom Action
Launch a screen flow from a Salesforce Maps custom action so reps can capture a checklist, survey, or notes from a marker.
Required Editions
| View supported editions. |
| User Permissions Needed | |
|---|---|
| To create flows: | Manage Flow |
| To configure custom actions: | Customize Application |
A Maps custom action can launch a screen flow from a plotted marker. Use this pattern when reps capture structured details from a marker and Salesforce writes those responses to a related record. Build a screen flow that accepts the marker's record ID, then connect it to a custom action button.
Build the Screen Flow
Create a screen flow for the object that your reps plot on the map. The example uses the Account object. You can adapt it to leads, contacts, cases, or custom objects.
- Enter Flows in the Quick Find box, and then select Flows.
- Click New Flow. Select Screen Flow, click Next, and then select Auto-Layout.
- Click New Resource and select Variable. For the API name, enter recordId. For the data type, select Text. Select Available for input, and then click Done. Salesforce Maps passes the ID of the record behind the marker into this variable.
- Add a Get Records element and label it for your object (for example, Get Account Record). Select the object, and then filter its records.
Set This Filter Element To Field Id Operator Equals Value recordId - Add a Screen element. Enter a label, clear Show Header and Pause, and add the screen components that you want reps to complete, such as checkboxes or input fields.
- Add a Create Records element (or Update Records to write to an existing record) to store the responses, for example in a related Task. Set the required field values, and then map each screen component to a field.
Field Example Value WhatId recordIdOwnerId {!Get_Account_Record.OwnerId}Subject Check-in at {!Get_Account_Record.Name}Status Completed - Select the record element, click Add Fault Path, and add a Screen with a Display Text component that tells reps what to do if Salesforce can't save their responses.
- Add a confirmation Screen with a Display Text component, and then save the flow. Note its API name. You need it for the custom action.
Create a Custom Action That Launches the Flow
- Enter Installed Packages in the Quick Find box, and then select Installed Packages.
- Find the Salesforce Maps package, and then click Configure.
- Select Settings | Custom Actions.
- Select Create New, name the custom action, and then select Activity Support and Verified Location Support.
- Select the action Launch Visual Flow, and then enter the API name of the flow that you created.
- Save your work.
Add the Action to a Button Set
- Select Button Set Name in Salesforce Maps Settings.
- Select the button set that you want to add the custom action to.
- Find the new button, and then drag it where you want it to appear in the Popup layout.
- Save your work.
Test the Flow
- Plot a layer whose object corresponds with the flow that you created.
- Click a marker, select Actions, and then click the button that you added.
- Complete the screen, click Next, and then click Finish. Salesforce writes the responses to the related record.
Did this article solve your issue?
Let us know so we can improve!
