# Scripting for tag which value changes according to query

**URL:** <https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 17, 2024, 7:23am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370 "2024-01-17T07:23:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![necromancer](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@necromancer](https://forum.inductiveautomation.com/u/necromancer)\
**Post date:** [January 17, 2024, 7:23am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/1 "2024-01-17T07:23:38Z")

</div>

I need to know which method to use for which i have a query with values. i want it to bind to tags by which it changes value according to date and time on the query data through a slider.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 17, 2024, 8:07am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/2 "2024-01-17T08:07:37Z")

</div>

I don't have the slightest clue what you're asking. You'll need to be a bit (or maybe even a lot) clearer about what you want to do.

---

<div class="post-metadata">

**Author:** ![necromancer](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@necromancer](https://forum.inductiveautomation.com/u/necromancer)\
**Post date:** [January 17, 2024, 9:02am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/3 "2024-01-17T09:02:28Z")

</div>

i have a database with name,percentage,time . i want to assign them to labels and put a slider which changes the tag values .

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 17, 2024, 9:59am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/4 "2024-01-17T09:59:59Z")

</div>

> [@necromancer](#):
>
> I have a database with name,percentage,time . i want to assign them to labels ...

That part is easy. Create a named query or SQL binding for each label. It will extract just one value or string from the database. The query will need some parameters for the WHERE clause.

> [@necromancer](#):
>
> ... and put a slider which changes the tag values.

This part is not clear.

1. What is the relationship between tags and the database?
2. What happens when the slider is adjusted?
3. What is the application supposed to do?

Please answer points 1, 2 and 3.

---

<div class="post-metadata">

**Author:** ![necromancer](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@necromancer](https://forum.inductiveautomation.com/u/necromancer)\
**Post date:** [January 17, 2024, 10:23am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/5 "2024-01-17T10:23:17Z")

</div>

1. the database is the historical values of the tags  
2)the tag value should change based on past data with respect to time  
3)give previous data stored which is represented in tags

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 17, 2024, 10:33am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/6 "2024-01-17T10:33:01Z")

</div>

Still not clear.  
Sorry, but you need to write a much better specification and maybe add a screen-grab of a mock-up.

> 2)the tag value should change based on past data with respect to time

Are you trying to create a datetime picker using the Slider component?

> 3)give previous data stored which is represented in tags

Stored data is not "represented in tags". Tag data is stored in the historian.

Tip: the markdown syntax for numbered lists is `1. ` (a space following the dot).

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 17, 2024, 12:55pm UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/7 "2024-01-17T12:55:05Z")

</div>

Some slightly important information is missing. What visualization module are you using? Vision or Perspective? The potential solutions can vary greatly depending on that information.

---

<div class="post-metadata">

**Author:** ![necromancer](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@necromancer](https://forum.inductiveautomation.com/u/necromancer)\
**Post date:** [January 18, 2024, 5:56am UTC](https://forum.inductiveautomation.com/t/scripting-for-tag-which-value-changes-according-to-query/84370/8 "2024-01-18T05:56:02Z")

</div>

perspective
