Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Pass Data to an LWC with Deep Linking
To pass parameters using deep linking, such as passing data into an LWC form, use the quick actions URI schema with your LWC quick action as the <api_name>, followed by the parameter key and value pairs.
1com.salesforce.fieldservice://v1/sObject/<id>/quickaction/<api_name>?<parameterKey1>=<parameterValue1>&<parameterKey2>=<parameterValue2>&...Here’s an example of a deep link URL that passes the first and last name of Jane Doe to an LWC using a quick action called LWC_Pass_Fields.
1/quickaction/LWC_Pass_Fields?FirstName=Jane&LastName=DoeTo pass the data, also update the LWC source code of the current page reference, the LWC that the deep link opens. Here’s an example of an LWC that passes the parameter value into the corresponding parameter key of the current page reference.
1import {CurrentPageReference} from 'lightning/navigation';
2
3// Declare the variable for the parameter value.
4parameterValue;
5
6// Call the page reference that describes the current LWC page.
7@wire(CurrentPageReference)
8setCurrentPageReference(currentPageReference) {
9 // Pass parameter values using the currentPageReference state attribute.
10 // Replace <parameterKey> with the parameter key name used in the deep link URL.
11 this.parameterValue = currentPageReference.state.<parameterKey>;
12}