# Multiple input function

**URL:** <https://discourse.nodered.org/t/multiple-input-function/10901>\
**Category:** General\
**Created:** [7 May 2019 21:00 UTC](https://discourse.nodered.org/t/multiple-input-function/10901 "2019-05-07T21:00:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjrivasescola](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jjrivasescola](https://discourse.nodered.org/u/jjrivasescola)\
**Post date:** [7 May 2019 21:00 UTC](https://discourse.nodered.org/t/multiple-input-function/10901/1 "2019-05-07T21:00:23Z")

</div>

Hello,

Would you like to help me on my project?

The input data (stored on a array) always have the same order: date1, time1, model1, date2, time2, model2, ... , dateN, timeN, modelN.

I would like to compare with a function if the input info (red part) and dates and time (blue part) are the same.

 ![23](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/ab9d958f604ac0ddc4860fbe492b1b9219c7713d.png)

Example:  
if the date1 and the actual date are the same then compare if the time1 and the actual time are the same then show the model1...

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [7 May 2019 21:17 UTC](https://discourse.nodered.org/t/multiple-input-function/10901/2 "2019-05-07T21:17:48Z")

</div>

One of the easiest ways to compare times is to covert them both to seconds from 1 Jan 1970

If you google “javascript seconds from 1 Jan 1979” you’ll find out more

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [7 May 2019 22:03 UTC](https://discourse.nodered.org/t/multiple-input-function/10901/3 "2019-05-07T22:03:06Z")

</div>

The input data is in 1 big array, not very handy.

But you can compare the actual text, ie

```auto
arr=msg.payload

If(arr[0]==arr[12] && arr[1]==arr[13){ 
Do stuff
}

```
