# Date picker String in url part

**URL:** <https://discourse.nodered.org/t/date-picker-string-in-url-part/68637>\
**Category:** Dashboard\
**Tags:** node-red-dashboard, function-node\
**Created:** [6 October 2022 12:00 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637 "2022-10-06T12:00:52Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 12:00 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/1 "2022-10-06T12:00:52Z")

</div>

Hello

i have a problem which i dont know how to solfe (read the paper for the date picker but it dosent work for me)

i have this Date Picker in my Dashboard

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/d/8d9ee9ee0b2867a9974a9fa905e2684a6c08905b.png)

Now i want pick the date and trow it in a url.

I have this function and want to include the output in the URL. There will be a 2nd datapicker which should come to a second place in the URL.

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/ef9d1dc66db4ff28c0c2c472d373a262516e35e2.png)

The URL looks like this:  
[https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=2022-10-04,toDateTime=2022-10-05)](https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=2022-10-04,toDateTime=2022-10-05))

Now i want to pick the "von" data to "fromDateTime=yyyy-mm-dd" and the "bis" data to "toDateTime=yyyy-mm-dd" in this url.

Maybe sime one have the solution for it

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 October 2022 12:16 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/2 "2022-10-06T12:16:05Z")

</div>

Here is an example using a change node and a form node, it uses JSONata and moments to format the date and adjust any time zone, it the concatenates the url.

```auto
[{"id":"552f973997e16203","type":"ui_form","z":"fe76f7928e585317","name":"","label":"","group":"2d4fe667.28f8ba","order":15,"width":0,"height":0,"options":[{"label":"from","value":"from","type":"date","required":true,"rows":null},{"label":"to","value":"to","type":"date","required":true,"rows":null}],"formValue":{"from":"","to":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":150,"y":2440,"wires":[["bd521561b6acb97e"]]},{"id":"bd521561b6acb97e","type":"change","z":"fe76f7928e585317","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=\" & \t$moment($$.payload.from).tz(\"Europe/London\").format(\"DD-MM-YYYY\") & \t\",toDateTime=\" & \t$moment($$.payload.to).tz(\"Europe/London\").format(\"DD-MM-YYYY\") & \t\")\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":2440,"wires":[["5f521f6e4526fbed"]]},{"id":"5f521f6e4526fbed","type":"debug","z":"fe76f7928e585317","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":2360,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 12:35 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/3 "2022-10-06T12:35:11Z")

</div>

Ok the url get generated. But i become the error "invalid url" when i want put it in the http request

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/419786567fa427a6527b5337ff5754ac6074d6b1.png)

i try it with {{payload}} and {{msg.payload}} both dosent work for me also try with all three "userdaten (payload)" without a fix

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 October 2022 12:40 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/4 "2022-10-06T12:40:25Z")

</div>

Use triple {{{payload}}}  
from the http node info help text

> Using {{{...}}} prevents mustache from escaping characters like / & etc.

Alternatively set the url to msg.url and leave http url input blank.  
e.g.

```auto
[{"id":"f1445127b52eb50e","type":"ui_form","z":"fe76f7928e585317","name":"","label":"","group":"2d4fe667.28f8ba","order":15,"width":0,"height":0,"options":[{"label":"from","value":"from","type":"date","required":true,"rows":null},{"label":"to","value":"to","type":"date","required":true,"rows":null}],"formValue":{"from":"","to":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":130,"y":2300,"wires":[["e97e8b2e48fdc894"]]},{"id":"e97e8b2e48fdc894","type":"change","z":"fe76f7928e585317","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"\"https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=\" & \t$moment($$.payload.from).tz(\"Europe/London\").format(\"DD-MM-YYYY\") & \t\",toDateTime=\" & \t$moment($$.payload.to).tz(\"Europe/London\").format(\"DD-MM-YYYY\") & \t\")\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":2300,"wires":[["6ebcdc0686359616"]]},{"id":"6ebcdc0686359616","type":"http request","z":"fe76f7928e585317","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":490,"y":2320,"wires":[["c33b83b26bab4505"]]},{"id":"c33b83b26bab4505","type":"debug","z":"fe76f7928e585317","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":2320,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 12:51 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/5 "2022-10-06T12:51:41Z")

</div>

I get a token from the previous steps which I have to include in the URL. But this is not forwarded because of the forma

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a338af7836514611b10d2183637f182c1ff3a9d6.png)

It looks like this. But after the Date part, it dont do anything

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/ed1ae71d7341c152368581a7c2833408c7146026.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 October 2022 13:05 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/6 "2022-10-06T13:05:34Z")

</div>

It is best to give all info in the first post. Also images are not the best as no one can copy the text and post an example with your data.

If you are running node-red 3.2, then you can add the authentication header in the http request node.

[edit]  
example

```auto
[{"id":"75ee466a384296c9","type":"inject","z":"fe76f7928e585317","name":"result of first http request","props":[{"p":"payload.access_token","v":"Basdfghj","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":230,"y":2160,"wires":[["a6af4c814a06d9d9"]]},{"id":"a6af4c814a06d9d9","type":"change","z":"fe76f7928e585317","name":"","rules":[{"t":"set","p":"payload.access_token","pt":"msg","to":"\"Bearer \" & $$.payload.access_token","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":2160,"wires":[["39c68265a34fe744"]]},{"id":"39c68265a34fe744","type":"join","z":"fe76f7928e585317","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":550,"y":2200,"wires":[["ca8226b2a8011cdb"]]},{"id":"dde82edbc8a62b33","type":"change","z":"fe76f7928e585317","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"\"https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=\" & \t$moment($$.payload.from).tz(\"Europe/London\").format(\"DD-MM-YYYY\") & \t\",toDateTime=\" & \t$moment($$.payload.to).tz(\"Europe/London\").format(\"DD-MM-YYYY\") & \t\")\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":2240,"wires":[["39c68265a34fe744"]]},{"id":"ca8226b2a8011cdb","type":"switch","z":"fe76f7928e585317","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"form","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":2200,"wires":[["b9aee1661dffcbfc"]]},{"id":"d77f9e70d392ce3a","type":"ui_form","z":"fe76f7928e585317","name":"","label":"","group":"2d4fe667.28f8ba","order":15,"width":0,"height":0,"options":[{"label":"from","value":"from","type":"date","required":true,"rows":null},{"label":"to","value":"to","type":"date","required":true,"rows":null}],"formValue":{"from":"","to":""},"payload":"","submit":"submit","cancel":"cancel","topic":"torm","topicType":"str","splitLayout":"","className":"","x":130,"y":2240,"wires":[["dde82edbc8a62b33"]]},{"id":"b9aee1661dffcbfc","type":"http request","z":"fe76f7928e585317","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Authorization","valueType":"msg","valueValue":"payload.access_token"}],"x":590,"y":2260,"wires":[["a0964be414ecabcd"]]},{"id":"a0964be414ecabcd","type":"debug","z":"fe76f7928e585317","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":2260,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 13:38 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/7 "2022-10-06T13:38:53Z")

</div>

This is unfortunately too high for me. I now have a mess. will probably have to undo everything and enter the date manually each day.  
I no longer understand where I have to enter what with the join and switch etc.. Thanks anyway for your efforts.

Here is the code which I have so far (secret ids etc I had to removed)

```auto
[{"id":"9f11e0559d57c435","type":"tab","label":"Telefon History","disabled":false,"info":"","env":[]},{"id":"bdbfaae1fc42e876","type":"inject","z":"9f11e0559d57c435","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"0.5","topic":"","payload":"","payloadType":"date","x":80,"y":40,"wires":[["7d2f789f975a8835"]]},{"id":"332e34ad2e399ceb","type":"http request","z":"9f11e0559d57c435","name":"Post Request absenden","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://login.microsoftonline.com/MYID/oauth2/v2.0/token","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":370,"y":200,"wires":[["dab2069bcddc1025","5f521f6e4526fbed"]]},{"id":"7d2f789f975a8835","type":"function","z":"9f11e0559d57c435","name":"Post Part erstellen","func":"msg.payload = {\n \"client_id\": \"MYCLIENTID\",\n \"scope\": \"https://graph.microsoft.com/.default\",\n \"client_secret\": 'MYSECRETID',\n \"grant_type\": \"client_credentials\"\n};\nmsg.headers = {};\nmsg.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":140,"wires":[["332e34ad2e399ceb"]]},{"id":"dab2069bcddc1025","type":"json","z":"9f11e0559d57c435","name":"JSON Response abfangen","property":"payload","action":"","pretty":false,"x":360,"y":260,"wires":[["8c7ea2297ee66efb"]]},{"id":"40dbdefb476cd315","type":"http request","z":"9f11e0559d57c435","name":"Get Request absenden","method":"GET","ret":"txt","paytoqs":"ignore","url":"{{{payload}}}","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":410,"y":480,"wires":[["ec3f13cdf7b294c5","122f781dbb619410"]]},{"id":"8c7ea2297ee66efb","type":"function","z":"9f11e0559d57c435","name":"Header Request vorbereiten","func":"msg.headers = {};\nmsg.headers = {\n Authorization: \"Bearer \" + msg.payload.access_token\n \n};\nmsg.headers[\"Content-Type\"] = \"application/json\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":320,"wires":[["552f973997e16203"]]},{"id":"ec3f13cdf7b294c5","type":"json","z":"9f11e0559d57c435","name":"","property":"payload","action":"","pretty":false,"x":370,"y":600,"wires":[["47742f60d9d455df"]]},{"id":"7689c002eb80a439","type":"ui_button","z":"9f11e0559d57c435","name":"","group":"4fce8c2af3820dd7","order":2,"width":0,"height":0,"passthru":false,"label":"Hole Daten","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":90,"y":120,"wires":[["7d2f789f975a8835"]]},{"id":"7da81c9ddc68e882","type":"ui_table","z":"9f11e0559d57c435","group":"4fce8c2af3820dd7","name":"","order":3,"width":"20","height":"15","columns":[],"outputs":0,"cts":false,"x":890,"y":560,"wires":[]},{"id":"47742f60d9d455df","type":"function","z":"9f11e0559d57c435","name":"function 1","func":"msg.payload = msg.payload.value.map(e => {\n return {\n \"Anrufzeit\": e.startDateTime,\n \"Anurfnummer\": e.callerNumber,\n \"Anrufdauer in Sekunden\" : e.duration,\n \"Display Name\": e.userDisplayName\n }\n})\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":580,"wires":[["7da81c9ddc68e882"]]},{"id":"122f781dbb619410","type":"debug","z":"9f11e0559d57c435","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":400,"wires":[]},{"id":"552f973997e16203","type":"ui_form","z":"9f11e0559d57c435","name":"","label":"","group":"4fce8c2af3820dd7","order":1,"width":0,"height":0,"options":[{"label":"from","value":"from","type":"date","required":true,"rows":null},{"label":"to","value":"to","type":"date","required":true,"rows":null}],"formValue":{"from":"","to":""},"payload":"","submit":"Daten Holen","cancel":"Abbrechen","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":170,"y":380,"wires":[["bd521561b6acb97e"]]},{"id":"bd521561b6acb97e","type":"change","z":"9f11e0559d57c435","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=\" & \t$moment($$.payload.from).tz(\"Europe/London\").format(\"YYYY-MM-DD\") & \t\",toDateTime=\" & \t$moment($$.payload.to).tz(\"Europe/London\").format(\"YYYY-MM-DD\") & \t\")\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":380,"wires":[["40dbdefb476cd315"]]},{"id":"5f521f6e4526fbed","type":"debug","z":"9f11e0559d57c435","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":260,"wires":[]},{"id":"4fce8c2af3820dd7","type":"ui_group","name":"Teams History","tab":"9bb60f34ca928aab","order":4,"disp":true,"width":"20","collapse":false,"className":""},{"id":"9bb60f34ca928aab","type":"ui_tab","name":"Hauptfenster","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 October 2022 14:00 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/8 "2022-10-06T14:00:33Z")

</div>

Try this

```auto
[{"id":"8c7ea2297ee66efb","type":"function","z":"9f11e0559d57c435","name":"Header Request vorbereiten","func":"msg.headers = {};\nmsg.payload.access_token = \"Bearer \" + msg.payload.access_token;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":260,"wires":[["b38033df69bb8a76","5f521f6e4526fbed"]]},{"id":"332e34ad2e399ceb","type":"http request","z":"9f11e0559d57c435","name":"Post Request absenden","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://login.microsoftonline.com/MYID/oauth2/v2.0/token","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":370,"y":200,"wires":[["5f521f6e4526fbed","8c7ea2297ee66efb"]]},{"id":"149ddf3238dcacc4","type":"inject","z":"9f11e0559d57c435","name":"","props":[{"p":"payload.access_token","v":"asdfghjk","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":280,"wires":[["8c7ea2297ee66efb"]]},{"id":"b38033df69bb8a76","type":"join","z":"9f11e0559d57c435","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":590,"y":340,"wires":[["25a36c5bc6f001eb"]]},{"id":"5f521f6e4526fbed","type":"debug","z":"9f11e0559d57c435","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":260,"wires":[]},{"id":"7d2f789f975a8835","type":"function","z":"9f11e0559d57c435","name":"Post Part erstellen","func":"msg.payload = {\n \"client_id\": \"MYCLIENTID\",\n \"scope\": \"https://graph.microsoft.com/.default\",\n \"client_secret\": 'MYSECRETID',\n \"grant_type\": \"client_credentials\"\n};\nmsg.headers = {};\nmsg.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":140,"wires":[["332e34ad2e399ceb"]]},{"id":"552f973997e16203","type":"ui_form","z":"9f11e0559d57c435","name":"","label":"","group":"4fce8c2af3820dd7","order":1,"width":0,"height":0,"options":[{"label":"from","value":"from","type":"date","required":true,"rows":null},{"label":"to","value":"to","type":"date","required":true,"rows":null}],"formValue":{"from":"","to":""},"payload":"","submit":"Daten Holen","cancel":"Abbrechen","topic":"form","topicType":"str","splitLayout":"","className":"","x":430,"y":340,"wires":[["b38033df69bb8a76"]]},{"id":"25a36c5bc6f001eb","type":"switch","z":"9f11e0559d57c435","name":"send if form is sent","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"form","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":340,"wires":[["bd521561b6acb97e"]]},{"id":"bdbfaae1fc42e876","type":"inject","z":"9f11e0559d57c435","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"0.5","topic":"","payload":"","payloadType":"date","x":80,"y":40,"wires":[["7d2f789f975a8835"]]},{"id":"7689c002eb80a439","type":"ui_button","z":"9f11e0559d57c435","name":"","group":"4fce8c2af3820dd7","order":2,"width":0,"height":0,"passthru":false,"label":"Hole Daten","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":90,"y":120,"wires":[["7d2f789f975a8835"]]},{"id":"bd521561b6acb97e","type":"change","z":"9f11e0559d57c435","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"\"https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=\" & \t$moment($$.payload.from).tz(\"Europe/London\").format(\"YYYY-MM-DD\") & \t\",toDateTime=\" & \t$moment($$.payload.to).tz(\"Europe/London\").format(\"YYYY-MM-DD\") & \t\")\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":400,"wires":[["f4474fc86c2ec6e6","40dbdefb476cd315"]]},{"id":"f4474fc86c2ec6e6","type":"debug","z":"9f11e0559d57c435","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":760,"y":400,"wires":[]},{"id":"40dbdefb476cd315","type":"http request","z":"9f11e0559d57c435","name":"Get Request absenden","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Authorization","valueType":"msg","valueValue":"access_token"}],"x":410,"y":480,"wires":[["122f781dbb619410","47742f60d9d455df"]]},{"id":"122f781dbb619410","type":"debug","z":"9f11e0559d57c435","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":480,"wires":[]},{"id":"47742f60d9d455df","type":"function","z":"9f11e0559d57c435","name":"function 1","func":"msg.payload = msg.payload.value.map(e => {\n return {\n \"Anrufzeit\": e.startDateTime,\n \"Anurfnummer\": e.callerNumber,\n \"Anrufdauer in Sekunden\" : e.duration,\n \"Display Name\": e.userDisplayName\n }\n})\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":580,"wires":[["7da81c9ddc68e882"]]},{"id":"7da81c9ddc68e882","type":"ui_table","z":"9f11e0559d57c435","group":"4fce8c2af3820dd7","name":"","order":3,"width":"20","height":"15","columns":[],"outputs":0,"cts":false,"x":890,"y":560,"wires":[]},{"id":"4fce8c2af3820dd7","type":"ui_group","name":"Teams History","tab":"9bb60f34ca928aab","order":4,"disp":true,"width":"20","collapse":false,"className":""},{"id":"9bb60f34ca928aab","type":"ui_tab","name":"Hauptfenster","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 14:08 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/9 "2022-10-06T14:08:24Z")

</div>

> [@E1cid](#):
>
> `":"`

When i click on the "Daten Holen" Button under the "Date form"

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee82d9e56f10f46b7eb2a895594206732ce31872.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 October 2022 14:12 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/10 "2022-10-06T14:12:49Z")

</div>

Expand the debug objects so we can see the payloads.  
Are you using node-red 3.0.2?  
You also need to press HOLE DATEN first to retrieve the token.

---

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 14:20 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/11 "2022-10-06T14:20:33Z")

</div>

Yes i use 3.0.2

Which butten must i press? the "Hole Daten" Button or the button from the Form?

Because when i press "Hole Daten" then, they just take the Bear Token.

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/85fe0f9e5db6332e3ac52dee1133c7a562f3a282.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 October 2022 14:26 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/12 "2022-10-06T14:26:24Z")

</div>

All the payload objects from debugs, half info does not help.

you need to press "hole daten" to retrieve the access code. then "daten holen" to send the form.

---

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 14:32 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/13 "2022-10-06T14:32:11Z")

</div>

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f96327d563c3976ab63ed04624d6c0ec89244d39.png)

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c6f23841af2b6dabc9191202969e8e5b4b7f2593.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 October 2022 14:35 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/14 "2022-10-06T14:35:56Z")

</div>

~~If you want me to see what is going on you will need to send me the access\_token in a pm, The access token only works for 1 hour then is usless. I will not require your secret key~~  
[edit] there was an typo in the header of http request node.  
try this

```auto
[{"id":"bdbfaae1fc42e876","type":"inject","z":"9f11e0559d57c435","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"0.5","topic":"","payload":"","payloadType":"date","x":90,"y":40,"wires":[["7d2f789f975a8835"]]},{"id":"7d2f789f975a8835","type":"function","z":"9f11e0559d57c435","name":"Post Part erstellen","func":"msg.payload = {\n \"client_id\": \"MYCLIENTID\",\n \"scope\": \"https://graph.microsoft.com/.default\",\n \"client_secret\": 'MYSECRETID',\n \"grant_type\": \"client_credentials\"\n};\nmsg.headers = {};\nmsg.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":140,"wires":[["332e34ad2e399ceb"]]},{"id":"7689c002eb80a439","type":"ui_button","z":"9f11e0559d57c435","name":"","group":"4fce8c2af3820dd7","order":2,"width":0,"height":0,"passthru":false,"label":"Hole Daten","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":90,"y":120,"wires":[["7d2f789f975a8835"]]},{"id":"332e34ad2e399ceb","type":"http request","z":"9f11e0559d57c435","name":"Post Request absenden","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://login.microsoftonline.com/MYID/oauth2/v2.0/token","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":370,"y":200,"wires":[["5f521f6e4526fbed","8c7ea2297ee66efb"]]},{"id":"5f521f6e4526fbed","type":"debug","z":"9f11e0559d57c435","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":620,"y":260,"wires":[]},{"id":"8c7ea2297ee66efb","type":"function","z":"9f11e0559d57c435","name":"Header Request vorbereiten","func":"msg.headers = {};\nmsg.payload.access_token = \"Bearer \" + msg.payload.access_token;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":260,"wires":[["b38033df69bb8a76","5f521f6e4526fbed"]]},{"id":"554d34610ea61e05","type":"inject","z":"9f11e0559d57c435","name":"","props":[{"p":"payload.access_token","v":"","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":90,"y":260,"wires":[["8c7ea2297ee66efb"]]},{"id":"b38033df69bb8a76","type":"join","z":"9f11e0559d57c435","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":590,"y":340,"wires":[["25a36c5bc6f001eb"]]},{"id":"552f973997e16203","type":"ui_form","z":"9f11e0559d57c435","name":"","label":"","group":"4fce8c2af3820dd7","order":1,"width":0,"height":0,"options":[{"label":"from","value":"from","type":"date","required":true,"rows":null},{"label":"to","value":"to","type":"date","required":true,"rows":null}],"formValue":{"from":"","to":""},"payload":"","submit":"Daten Holen","cancel":"Abbrechen","topic":"form","topicType":"str","splitLayout":"","className":"","x":430,"y":340,"wires":[["b38033df69bb8a76"]]},{"id":"25a36c5bc6f001eb","type":"switch","z":"9f11e0559d57c435","name":"send if form is sent","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"form","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":340,"wires":[["bd521561b6acb97e"]]},{"id":"bd521561b6acb97e","type":"change","z":"9f11e0559d57c435","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"\"https://graph.microsoft.com/beta/communications/callRecords/getDirectRoutingCalls(fromDateTime=\" & \t$moment($$.payload.from).tz(\"Europe/London\").format(\"YYYY-MM-DD\") & \t\",toDateTime=\" & \t$moment($$.payload.to).tz(\"Europe/London\").format(\"YYYY-MM-DD\") & \t\")\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":400,"wires":[["f4474fc86c2ec6e6","40dbdefb476cd315"]]},{"id":"f4474fc86c2ec6e6","type":"debug","z":"9f11e0559d57c435","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":400,"wires":[]},{"id":"40dbdefb476cd315","type":"http request","z":"9f11e0559d57c435","name":"Get Request absenden","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Authorization","valueType":"msg","valueValue":"payload.access_token"}],"credentials":{},"x":410,"y":480,"wires":[["122f781dbb619410","47742f60d9d455df"]]},{"id":"122f781dbb619410","type":"debug","z":"9f11e0559d57c435","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":480,"wires":[]},{"id":"47742f60d9d455df","type":"function","z":"9f11e0559d57c435","name":"function 1","func":"msg.payload = msg.payload.value.map(e => {\n return {\n \"Anrufzeit\": e.startDateTime,\n \"Anurfnummer\": e.callerNumber,\n \"Anrufdauer in Sekunden\" : e.duration,\n \"Display Name\": e.userDisplayName\n }\n})\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":540,"wires":[["7da81c9ddc68e882"]]},{"id":"7da81c9ddc68e882","type":"ui_table","z":"9f11e0559d57c435","group":"4fce8c2af3820dd7","name":"","order":3,"width":"20","height":"15","columns":[],"outputs":0,"cts":false,"x":730,"y":540,"wires":[]},{"id":"4fce8c2af3820dd7","type":"ui_group","name":"Teams History","tab":"9bb60f34ca928aab","order":4,"disp":true,"width":"20","collapse":false,"className":""},{"id":"9bb60f34ca928aab","type":"ui_tab","name":"Hauptfenster","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![dereine](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dereine](https://discourse.nodered.org/u/dereine)\
**Post date:** [6 October 2022 14:43 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/15 "2022-10-06T14:43:12Z")

</div>

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/132a59904e8620fac444f84223c8a728b0b426f4.png)

This works =)  
Thank you very much for your help

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 October 2022 14:43 UTC](https://discourse.nodered.org/t/date-picker-string-in-url-part/68637/16 "2022-10-20T14:43:29Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
