# Can't set a dashbord time value in form

**URL:** <https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [12 April 2022 15:04 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185 "2022-04-12T15:04:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vrrrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vrrrum/32/60000_2.png) [@Vrrrum](https://discourse.nodered.org/u/Vrrrum)\
**Post date:** [12 April 2022 15:04 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/1 "2022-04-12T15:04:07Z")

</div>

Hello,  
I'm trying to set the value of date input, in the form element. So I tried to inject the time in by json object, just like you do with other input types in form. But for some reason it doesn't work. Input value stays blank after injecting data. I have no clue what am I doing wrong.  
Here's my flow:

```auto
[{"id":"8c8e52738736b72b","type":"ui_form","z":"7aeceadca429cc4c","name":"","label":"","group":"d17d627c5ecd8fd8","order":12,"width":4,"height":1,"options":[{"label":"Time","value":"text123","type":"time","required":true,"rows":null}],"formValue":{"text123":""},"payload":"","submit":"submit","cancel":"cancel","topic":"0","topicType":"str","splitLayout":"","x":350,"y":80,"wires":[[]]},{"id":"573bb5c765f76643","type":"inject","z":"7aeceadca429cc4c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"text123\": \"12:00\"}","payloadType":"json","x":170,"y":80,"wires":[["8c8e52738736b72b"]]},{"id":"d17d627c5ecd8fd8","type":"ui_group","name":"Group 1","tab":"c77ac24ef7619a05","order":1,"disp":true,"width":6},{"id":"c77ac24ef7619a05","type":"ui_tab","name":"Tab 4","icon":"dashboard","order":4}]

```

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [15 April 2022 02:31 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/2 "2022-04-15T02:31:54Z")

</div>

You need to inject an actual time date value eg - 1970-01-01T10:00:00.000Z

---

<div class="post-metadata">

**Author:** ![Vrrrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vrrrum/32/60000_2.png) [@Vrrrum](https://discourse.nodered.org/u/Vrrrum)\
**Post date:** [21 April 2022 19:41 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/3 "2022-04-21T19:41:34Z")

</div>

Hi, I tried doing it this way but it didn't work

```auto
[
    {
        "id": "352ae1707eb9ab1d",
        "type": "inject",
        "z": "aa75d57d2ade3cab",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"time\":\"1970-01-01T10:00:00.000Z\"}",
        "payloadType": "json",
        "x": 410,
        "y": 100,
        "wires": [
            [
                "1c8acc3d0c1ad7b6"
            ]
        ]
    },
    {
        "id": "1c8acc3d0c1ad7b6",
        "type": "ui_form",
        "z": "aa75d57d2ade3cab",
        "name": "",
        "label": "",
        "group": "",
        "order": 20,
        "width": 0,
        "height": 0,
        "options": [
            {
                "label": "",
                "value": "time",
                "type": "time",
                "required": true,
                "rows": null
            }
        ],
        "formValue": {
            "time": ""
        },
        "payload": "",
        "submit": "submit",
        "cancel": "cancel",
        "topic": "topic",
        "topicType": "msg",
        "splitLayout": "",
        "x": 580,
        "y": 100,
        "wires": [
            []
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [22 April 2022 23:32 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/4 "2022-04-22T23:32:11Z")

</div>

it works for me ?

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [23 April 2022 03:32 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/5 "2022-04-23T03:32:41Z")

</div>

works for me too...

---

<div class="post-metadata">

**Author:** ![Vrrrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vrrrum/32/60000_2.png) [@Vrrrum](https://discourse.nodered.org/u/Vrrrum)\
**Post date:** [24 April 2022 16:44 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/6 "2022-04-24T16:44:21Z")

</div>

Well... that's wired. Maybe there's something wrong with my dashbord installation. I'll try to reinstall dashboard

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [24 April 2022 16:53 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/7 "2022-04-24T16:53:11Z")

</div>

Does it display anything when you inject ?

---

<div class="post-metadata">

**Author:** ![Vrrrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vrrrum/32/60000_2.png) [@Vrrrum](https://discourse.nodered.org/u/Vrrrum)\
**Post date:** [24 April 2022 16:58 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/8 "2022-04-24T16:58:22Z")

</div>

No, it stays the same as it was. just "--:--". Even reinstallation of dashboard did nothing

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [24 April 2022 16:59 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/9 "2022-04-24T16:59:35Z")

</div>

Sorry not sure what to sugest then ?

---

<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:** [24 May 2022 16:59 UTC](https://discourse.nodered.org/t/cant-set-a-dashbord-time-value-in-form/61185/10 "2022-05-24T16:59:55Z")

</div>

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