Dynamic Embedded Flow Parameters
Kevin Wilde
Last Update 23 days ago
You can pass dynamic values from your storefront into the input of a Shopify Flow request. This allows your Flow automation to receive real-time data based on customer actions, session context, or storefront activity.
Dynamic embedded parameters are added as query parameters to calls made to APIEase from custom liquid in your storefront.
Example Javascript Snippet:
xxxxxxxxxx
14
1
<script>
2
const flowParamsEmbeddedVar = JSON.stringify({
3
exampleFlow1: "exampleFlowValue1",
4
exampleFlow2: "exampleFlowValue2",
5
exampleFlow3: "exampleFlowValue3",
6
});
7
const queryParams = new URLSearchParams({
8
requestId: "a1dd1880-ewsd-sdss-8f48-27f04dbadc31",
9
flowParamsEmbedded: flowParamsEmbeddedVar,
10
});
11
fetch('/apps/apiease/integration/caller/call?' + queryParams).
12
then(function(response) {return response.json();}).
13
then(function(jsonResponse) {console.log(jsonResponse);});
14
</script>
In the above javascript snippet we see that flowParamsEmbedded is set to the stringified "flowParamsEmbeddedVar". APIEase looks for a query parameter named flowParamsEmbedded to hold the dynamic embedded flow parameters.