Simple input

Use the simple input to load static data into the execution context when the watch is triggered. This enables you to store the data centrally and reference it with templates.

You can define the static data as a string (str), numeric value (num), or an object (obj):

  1. "input" : {
  2. "simple" : {
  3. "str" : "val1",
  4. "num" : 23,
  5. "obj" : {
  6. "str" : "val2"
  7. }
  8. }
  9. }

For example, the following watch uses the simple input to set the recipient name for a daily reminder email:

  1. {
  2. "trigger" : {
  3. "schedule" : {
  4. "daily" : { "at" : "noon" }
  5. }
  6. },
  7. "input" : {
  8. "simple" : {
  9. "name" : "John"
  10. }
  11. },
  12. "actions" : {
  13. "reminder_email" : {
  14. "email" : {
  15. "to" : "to@host.domain",
  16. "subject" : "Reminder",
  17. "body" : "Dear {{ctx.payload.name}}, by the time you read these lines, I'll be gone"
  18. }
  19. }
  20. }
  21. }