text: [{"id":"91cb119.d7790f","type":"inject","z":"91de3816.0cb58","name":"","topic":"","payload":"[\"orange\",\"apple\",\"kiwi\",\"watermelon\"]","payloadType":"json","repeat":"","crontab":"","once":false,"x":110,"y":80,"wires":[["61891024.703e98"]]},{"id":"8b62e162.9ccec","type":"debug","z":"91de3816.0cb58","name":"","active":true,"console":"false","complete":"false","x":390,"y":80,"wires":[]},{"id":"d93a0d1b.fc6ec","type":"inject","z":"91de3816.0cb58","name":"","topic":"","payload":"[\"orange\",\"apple\",\"kiwi\",\"watermelon\"]","payloadType":"json","repeat":"","crontab":"","once":false,"x":110,"y":140,"wires":[["ddc3b3bf.96e408"]]},{"id":"a5b38e88.0c72d8","type":"debug","z":"91de3816.0cb58","name":"","active":true,"console":"false","complete":"false","x":390,"y":140,"wires":[]},{"id":"61891024.703e98","type":"sort","z":"91de3816.0cb58","orderBy":"az","name":"Sort A-Z","x":240,"y":80,"wires":[["8b62e162.9ccec"]]},{"id":"ddc3b3bf.96e408","type":"sort","z":"91de3816.0cb58","orderBy":"za","name":"Sort Z-A","x":240,"y":140,"wires":[["a5b38e88.0c72d8"]]},{"id":"5c33af4a.6bfb38","type":"HTML-PDF","z":"91de3816.0cb58","name":"HTML-PDF","output":"buffer","x":430,"y":480,"wires":[["79330417.90d9cc"]]},{"id":"4a8f1511.512304","type":"http in","z":"91de3816.0cb58","name":"","url":"/roster","method":"get","swaggerDoc":"","x":110,"y":380,"wires":[["5df5f017.1e04"]]},{"id":"d75dcec2.6209f","type":"template","z":"91de3816.0cb58","name":"Generate HTML List","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n    <body>\n        <h1>My Sample Event Attendees</h1>\n        <ul>\n        {{#payload}}\n            <li>{{.}}</li>\n        {{/payload}}\n        </ul>\n    </body>\n</html>\n","x":240,"y":480,"wires":[["5c33af4a.6bfb38"]]},{"id":"260315b5.9d71fa","type":"http response","z":"91de3816.0cb58","name":"","x":730,"y":480,"wires":[]},{"id":"79330417.90d9cc","type":"function","z":"91de3816.0cb58","name":"Set Headers","func":"msg.headers = {\n    'content-type': 'application/pdf'\n};\nreturn msg;\n","outputs":1,"noerr":0,"x":590,"y":480,"wires":[["260315b5.9d71fa"]]},{"id":"3771d8f1.6efd1","type":"sort","z":"91de3816.0cb58","orderBy":"az","name":"","x":870,"y":380,"wires":[["d75dcec2.6209f"]]},{"id":"d466182f.edbe9","type":"http in","z":"91de3816.0cb58","name":"","url":"/register","method":"get","swaggerDoc":"","x":110,"y":200,"wires":[["23ba7e1a.6f2d52"]]},{"id":"23ba7e1a.6f2d52","type":"template","z":"91de3816.0cb58","name":"Display Form","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n    <head>\n        <title>Sign In</title>\n    </head>\n    <body>\n        <form method=\"POST\">\n            <h2>Please Sign In</h2>\n            Name: <input type=\"text\" name=\"name\" /><br />\n            <input type=\"submit\" value=\"Sign In\" />\n        </form>\n    </body>\n</html>\n","x":270,"y":200,"wires":[["7774a999.d011a8"]]},{"id":"7774a999.d011a8","type":"http response","z":"91de3816.0cb58","name":"","x":410,"y":200,"wires":[]},{"id":"676f2aad.673074","type":"http in","z":"91de3816.0cb58","name":"","url":"/register","method":"post","swaggerDoc":"","x":110,"y":300,"wires":[["fff8d9f0.b7aa48"]]},{"id":"a1c33261.d9554","type":"template","z":"91de3816.0cb58","name":"Display Confirmation","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n    <head>\n        <title>Sign In</title>\n    </head>\n    <body>\n        <p>Thanks for signing in <b>{{name}}</b>!</p>\n        <a href=\"/register\">Register another person</a>\n    </body>\n</html>\n","x":840,"y":300,"wires":[["1dd98632.8e581a"]]},{"id":"1dd98632.8e581a","type":"http response","z":"91de3816.0cb58","name":"","x":1010,"y":300,"wires":[]},{"id":"9241bd38.e09","type":"cloudant in","z":"91de3816.0cb58","name":"names","cloudant":"","database":"names","service":"","search":"_id_","design":"","index":"","x":430,"y":300,"wires":[["960b2f88.aabd88"]]},{"id":"960b2f88.aabd88","type":"function","z":"91de3816.0cb58","name":"Add Attendee to List","func":"// If no document was found, create a new one.\nif(!msg.payload) {\n    msg.payload = {\n        attendeelist: [], \n        _id: 'attendeelist'\n    };\n}\n\nmsg.payload.attendeelist.push(msg.name);\n\nreturn msg;\n","outputs":1,"noerr":0,"x":600,"y":300,"wires":[["4e3ed046.edf14","a1c33261.d9554"]]},{"id":"4e3ed046.edf14","type":"cloudant out","z":"91de3816.0cb58","name":"","cloudant":"","database":"names","service":"","payonly":true,"operation":"insert","x":790,"y":260,"wires":[]},{"id":"fff8d9f0.b7aa48","type":"change","z":"91de3816.0cb58","name":"","rules":[{"t":"set","p":"name","pt":"msg","to":"payload.name","tot":"msg"},{"t":"set","p":"payload.id","pt":"msg","to":"attendeelist","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":300,"wires":[["9241bd38.e09"]]},{"id":"bd0e86b7.4a3958","type":"cloudant in","z":"91de3816.0cb58","name":"names","cloudant":"","database":"names","service":"","search":"_id_","design":"","index":"","x":450,"y":380,"wires":[["7d5d3538.a62cf4"]]},{"id":"5df5f017.1e04","type":"change","z":"91de3816.0cb58","name":"","rules":[{"t":"set","p":"payload.id","pt":"msg","to":"attendeelist","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":380,"wires":[["bd0e86b7.4a3958"]]},{"id":"7d5d3538.a62cf4","type":"switch","z":"91de3816.0cb58","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"false","outputs":2,"x":570,"y":380,"wires":[["e9efff51.2ffb78"],["ac30db2.dae6428"]]},{"id":"ac30db2.dae6428","type":"change","z":"91de3816.0cb58","name":"Create List","rules":[{"t":"set","p":"payload","pt":"msg","to":"[]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":400,"wires":[["3771d8f1.6efd1"]]},{"id":"e9efff51.2ffb78","type":"change","z":"91de3816.0cb58","name":"Has List","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.attendeelist","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":360,"wires":[["3771d8f1.6efd1"]]},{"id":"5b4b22dc.61ee4c","type":"http in","z":"91de3816.0cb58","name":"","url":"/roster/reset","method":"get","swaggerDoc":"","x":120,"y":600,"wires":[["51bbe093.193fd"]]},{"id":"ea2d7463.bdc538","type":"template","z":"91de3816.0cb58","name":"List Cleared","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n    <body>\n        <p>List is cleared. <a href=\"/register\">Register</a></a></p>\n    </body>\n</html>\n","x":930,"y":605,"wires":[["1a2d5124.ce8247"]]},{"id":"1a2d5124.ce8247","type":"http response","z":"91de3816.0cb58","name":"","x":1141,"y":605,"wires":[]},{"id":"11ff7f50.11b839","type":"cloudant out","z":"91de3816.0cb58","name":"","cloudant":"","database":"names","service":"","payonly":true,"operation":"insert","x":910,"y":540,"wires":[]},{"id":"ae78ad10.af961","type":"cloudant in","z":"91de3816.0cb58","name":"names","cloudant":"","database":"names","service":"","search":"_id_","design":"","index":"","x":470,"y":600,"wires":[["3cde74b8.0ad03c"]]},{"id":"51bbe093.193fd","type":"change","z":"91de3816.0cb58","name":"","rules":[{"t":"set","p":"payload.id","pt":"msg","to":"attendeelist","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":600,"wires":[["ae78ad10.af961"]]},{"id":"3cde74b8.0ad03c","type":"switch","z":"91de3816.0cb58","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"false","outputs":2,"x":590,"y":600,"wires":[["dae60c18.2c6058"],["ea2d7463.bdc538"]]},{"id":"dae60c18.2c6058","type":"change","z":"91de3816.0cb58","name":"Empty List","rules":[{"t":"set","p":"payload.attendeelist","pt":"msg","to":"[]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":734,"y":571,"wires":[["11ff7f50.11b839","ea2d7463.bdc538"]]}]
  