When a component runs, it may generate response that you can use in the subsequent component.
Let's use our example of sending a text message with the current balance of a given token. This would require querying the Emblem service and then using the text messaging services to send the response from the Emblem service. We are using three components to achieve this:
- A trigger component to start the Circuit
- A component that queries for the balance
- A component that sends the SMS
When a component is selected, there are information tabs on the right hand side of your screen. The second tab is the Console from which the data from your queries will be available.
In our example, we need to send the balance data from the response to the SMS component. Here is what the response data might look like in the console:
response { "balance": 2.34, "address": "0x5b3cfb86a9575a2c42fd88aa71f0957004fa9209", "chain": "etc", "asset_name": "etc" }
As you can see from the response data, this address as 2.34 etc and the response is in JSON format. We are able to use any of the data in the JSON response by following its path. For our example, we want the balance so we would use response.balance. If we were looking for the address, we would use response.address.