Data Outputs
Most tasks give back a fixed set of outputs. Each of these outputs is a string you can use in your next task, and using them is as simple as inserting them into an input.
However, sometimes we don't know what data a method will come back with, and that data may change between each request. For this situation, we have a special output type called a Data Output.
You'll know your task has a data output because you'll see the { } symbol next to the output when you select it:
Prerequisites
Our data output is a more advanced feature, and will be easier to understand if you already know what JSON is. Don't worry if you don't though, it's not that difficult.
It's also much easier if you know what data your method comes back with, even better if you have some example data to hand. For example, if you're using the data output with a webhook action to fetch data from an API, it would be ideal to have an example response to hand.
See the Flow XO docs for examples of the data you'll get back from other methods. You can also run your flow and then view the log to see what data comes back - that might be necessary sometimes.
Referencing Data
So, you know what JSON looks like, and know what data you have available to you. Let's imagine we have a data output called data. You know it contains this:
{ "name": "Product A", "price": 150, "features": { "speed": 5, "weight": 20 }, "tags": [ { "id": 1 }, { "id": 3 }, { "id": 5 } ] }
Troubleshooting
- Accidentally using a single underscore instead of double.
- Using 1 instead of 0 to try and get the first item of an array.
- Data that changes between requests. You might set the method up based on what data you think you'll be receiving, but that might change as you start to use the flow for real - examine the log carefully to see what data you receive in each situation.
If the output points to a property that doesn't exist, the output will be replaced with an empty string (i.e. nothing is output).
Let us know how we can improve Flow XO on our feedback site.