"export attribute" in the example means the name of an attribute exported by an upstream channel, keyed by either an explicit channel id, or `source` (ie: whatever the bip receives or generates). This means you can concatenate exports and text together to create a custom import. With the previous email example, lets assume we're using an `smtp` bip and want to pass through some of the details to an email channel on its hub :
`json_path` in the example means the [JSON Path](http://goessner.net/articles/JsonPath/) of an attribute exported by an upstream channel, keyed by either an explicit channel id, or `source` (ie: whatever the bip receives or generates). This means you can concatenate exports and text together to create a custom import. With the previous email example, lets assume we're using an `smtp` bip and want to pass through some of the details to an email channel on its hub :
```
{
...
...
@@ -21,6 +21,35 @@ Templates can also be interpolated with variables from upstream channels or meta
"body_text" : "I got an email from [%_client#repr%] : [%source#body_text%]"
}
```
## Object and Array Passthrough
Transform templates which only include a single JSONPath will be evaluated in-place, meaning that if the path evaluates to an object or array, then it will be replaced with that structured data.
For example, say we have a channel with a `json_document` import which expects a structured object and you need to map an export object from a complex payload like so (the 2nd object element of an array) :
Additional metadata exports are available depending on the type of Bip that is evaluating. These exports are set in `_bip` and `_client` exports which can be discovered by calling the [`/rpc/describe/bip`](https://github.com/bipio-server/bipio/wiki/Describing-Models) RPC.