How to use existing data from your website in your flow
When you already have data available on your website that you want to use in your flow, you can send this data to Qonfi by setting them in window.qonfiVariables in JavaScript.
window.qonfiVariables = {
"allergies": "nuts, soja"
};
Once you've set your data in window.qonfiVariables, you can use this data as variables in your flow. For example, if we already know a user has certain allergies, we don't want to match any products that contain ingredients the user is allergic to.
1. Add an if/else node to collect variables.
Edit the answer of the if/else node and set the variables to the variables provided in window.qonfiVariables.
2. Add if/else nodes with conditions based on the allergy variable.
In this example, we want to check for both nuts and soja allergies.
For each if/else node, add the correct conditions to the answers. For example, for the "Nuts allergy: Yes" answer, we want to add a condition where we check if "Variable allergies -> contains -> nuts".
3. Add the matching rules to the if/else node answers.
In the "Matching" section, add the correct matching rules to the if/else node answers so we filter out any products that contain ingredients with the users' allergies.
Tip: The above example shows how we can use website data to match products. However, you can also use these variables to skip questions, do calculations etc.
Documentation