API | Watcher custom schema using jsonpath

Posted over 1 year ago by Julien Pauthier

Post a topic
  • Pinned Topic
Julien Pauthier
Julien Pauthier Admin

Our watchers support jsonpath, which can help navigate the JSON structure from our watchers (here a custom widget field identified with the external ID "test"), as well as to rely on Javascript to implement simple JS functions (eg: anonymise a lastname):


{
  "id": "${$.id}",
  "contact": {
    "emailAddress": "${$.client.email}",
    "name": "${$.client.firstName} ${$.client.lastName}",
    "phone": "${$.client.phone}"
  },
  "note": "${$.notes}",
  "additionalField1": ${$.form[?(@.externalId == 'test')].value},
  "service": {
    "name": "${$.service.name}",
    "appointmentType": "${$.service.externalId}"
  },
  "staff": {
    "name": "${$.staff.firstName} $eval{'${$.staff.lastName}'[0]}.",
    "ref": "${$.staff.externalId}"
  },
  "startTime": "${$.start.dateTime}",
  "endTime": "${$.end.dateTime}"
}


0 Votes


0 Comments

Login or Sign up to post a comment