# Conditional inputs issue

**URL:** <https://discourse.nodered.org/t/conditional-inputs-issue/46916>\
**Category:** General\
**Created:** [9 June 2021 13:31 UTC](https://discourse.nodered.org/t/conditional-inputs-issue/46916 "2021-06-09T13:31:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![edwardr](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@edwardr](https://discourse.nodered.org/u/edwardr)\
**Post date:** [9 June 2021 13:31 UTC](https://discourse.nodered.org/t/conditional-inputs-issue/46916/1 "2021-06-09T13:31:01Z")

</div>

Hello folks,

I am currently working on a project where I have data running through a function.

What I want is the function to not return any data unless a additional input condition is met.

So there two inputs - one is the flow of data, the other is the conditional 1 or 0.

When conditional is 1 , data flows,  
When conditional is 0, data stops

Is this possible on the current set up? I get the impression you can`t send multiple inputs to a function at all?

Thank you

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 June 2021 13:58 UTC](https://discourse.nodered.org/t/conditional-inputs-issue/46916/2 "2021-06-09T13:58:39Z")

</div>

> [@edwardr](#):
>
> I get the impression you can`t send multiple inputs to a function at all?

You can, just not at the same time.

There are a few ways so solve this and there are contrib nodes.

Here is a solution to permit data to flow through a function based on another input: [Cancel inputs for a period of time - #6 by Steve-Mcl](https://discourse.nodered.org/t/cancel-inputs-for-a-period-of-time/43749/6)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 June 2021 14:04 UTC](https://discourse.nodered.org/t/conditional-inputs-issue/46916/3 "2021-06-09T14:04:57Z")

</div>

Or another alternative is to use node-red-contrib-simple-gate to block/allow messages through.

---

<div class="post-metadata">

**Author:** ![edwardr](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@edwardr](https://discourse.nodered.org/u/edwardr)\
**Post date:** [10 June 2021 10:31 UTC](https://discourse.nodered.org/t/conditional-inputs-issue/46916/4 "2021-06-10T10:31:13Z")

</div>

Hi Colin,

So I used your approach but for some reason the gate doesnt seem to respond to open and close. I have attached my code for a review but as you can see , once closed the gate can`t be opened again - can you seen any issue here?

Best ,

E

[flows (28).json](https://discourse.nodered.org/uploads/short-url/pWnWVDDuk6i0K5tPZWWDAlWx0BY.json) (1.7 KB)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 June 2021 14:19 UTC](https://discourse.nodered.org/t/conditional-inputs-issue/46916/5 "2021-06-10T14:19:56Z")

</div>

I don't have access to a computer at the moment. Add a debug node showing the open and close messages you are sending, and also a screenshot of the gate node config.

---

<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 June 2021 14:20 UTC](https://discourse.nodered.org/t/conditional-inputs-issue/46916/6 "2021-06-24T14:20:20Z")

</div>

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