Overview
In certain workflows, it may be necessary to pass variables from a Logic+ flow into a CX project in order to trigger actions or processes within that environment. There are two methods for achieving this, depending on how the variables are being passed. This article covers both approaches and provides the corresponding code formatting for each.
Implementing these methods requires a foundational understanding of PHP. For additional CX customization resources, navigate to Developer > dot[CX] Docs within the Sharpen platform.
Method 1: Passing Logic+ Variables to Q Tab CX
Use this method when passing Logic+ variables directly to a CX project running in the Q Tab.
In this method, the code below extracts the value of a Logic+ variable and makes it available for use within the CX environment. Replace logicPlusVariableHere with the name of your Logic+ variable, and logicPlusVariableName with the name you want to reference it by within CX.
$callKey = $_GET['clickToCall'];
$call_details = $sharpen->getCallDetails($callKey);
$logicPlusVariableName = isset($call_details['data']['logicPlusVariableHere'])
? $call_details['data']['logicPlusVariableHere']
: '';
Once passed, the variable value can be referenced within CX as $logicPlusVariableName.
Method 2: Passing Logic+ Variables to CX via an Integration Panel
Use this method when Logic+ variables are being passed to CX through a Generic Integration panel within a Logic+ flow. This approach is better suited for more complex workflows where the CX process is triggered directly from within the Logic+ flow.
Replace logicPlusVariableHere with the name of your Logic+ variable, and logicPlusVariableName with the name you want to reference it by within CX.
$_POST = isset($_POST) && count($_POST)
? $_POST
: json_decode(file_get_contents("php://input"), true);
$logicPlusVariableName = $_POST['logicPlusVariableHere'] ?? '';
Once passed, the variable value can be referenced within CX as $logicPlusVariableName.
Choosing the Right Method
Scenario |
Recommended Method |
|---|---|
CX is running in the Q Tab and needs variable data from Logic+ |
Method 1 — Q Tab CX |
CX is triggered from within a Logic+ flow via an Integration panel |
Method 2 — Integration Panel |
This article is part of a series on Admin Configuration topics.