# Calling data from influxdb based on customer requirement

**URL:** <https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809>\
**Category:** Developing Nodes\
**Tags:** database\
**Created:** [16 November 2021 07:54 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809 "2021-11-16T07:54:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grimm1007](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@Grimm1007](https://discourse.nodered.org/u/Grimm1007)\
**Post date:** [16 November 2021 07:54 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809/1 "2021-11-16T07:54:42Z")

</div>

Hi, very new to node red and influxdb, I am working on a project that has to allow a user to call batch data from influxdb, i understand that we need to use query to get the data from influxdb but is there a way to have the user determine the data that they want to pull from influxdb to review. Currently the only way i can think of is to pull the entire database and then try to look through the data and compare that to the users input

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [16 November 2021 08:04 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809/2 "2021-11-16T08:04:00Z")

</div>

Welcome @Grimm1007

You can wright a query with parameters, same as any DB, the InfluxDB forum is very help full

---

<div class="post-metadata">

**Author:** ![Grimm1007](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@Grimm1007](https://discourse.nodered.org/u/Grimm1007)\
**Post date:** [16 November 2021 08:39 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809/3 "2021-11-16T08:39:32Z")

</div>

Do you mean adding "WHERE " into the query sentence ? I know I can do that but what I need to do is to have user choose the value at the end of the WHERE. For example in influx query we normally use

Select \* From measurement WHERE field =value

The value has to be an input from the user

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [16 November 2021 08:50 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809/4 "2021-11-16T08:50:25Z")

</div>

I your dashboard (send to your flow via MQTT) the user can input the value and then you build the query "SELECT \* FROM measurement WHERE field='user input'" and then you can return it to the user as on the dashboard or send to there server.

---

<div class="post-metadata">

**Author:** ![Grimm1007](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@Grimm1007](https://discourse.nodered.org/u/Grimm1007)\
**Post date:** [16 November 2021 10:17 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809/5 "2021-11-16T10:17:31Z")

</div>

I think what i need is more like a function that can pass user data into a query and then send that information to influxdb node as a query

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [16 November 2021 10:51 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809/6 "2021-11-16T10:51:38Z")

</div>

Yes you are correct.

You get the required parameters from the customer (via Dashboard, MQTT, Webhook or ?) , pass it into a change or function node and then do the query.

---

<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:** [15 January 2022 10:52 UTC](https://discourse.nodered.org/t/calling-data-from-influxdb-based-on-customer-requirement/53809/7 "2022-01-15T10:52:06Z")

</div>

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