set
ObjectSets a field to a literal value on an object, or on every object in an array. Useful for adding a constant tag, label, or computed string to every record in a pipeline.
Syntax
set:key,valuekeyField name to setvalueValue to assign (parsed as JSON if valid, otherwise a string)Use cases
| Use case | Description | URL | |
|---|---|---|---|
| Tag all records with a source | Add a "source" field to every item marking where the data came from. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/posts|head:5|set:source,jsonplaceholder | |
| Mark records as reviewed | Stamp a boolean "reviewed" flag on every object in a list. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/todos|head:5|set:reviewed,true | |
| Add a version field | Annotate API results with a version string for downstream consumers. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/users|head:3|set:apiVersion,v1 | |
| Set a numeric constant | Add a numeric constant field to each object in an array. | https://httpip.es/api/pipe/echo:[{"name":"a"},{"name":"b"}]|set:score,100 |