# Changing Perspective component properties with scripting

**URL:** <https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 25, 2024, 4:06pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754 "2024-07-25T16:06:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sawyer\_Jones](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Sawyer\_Jones](https://forum.inductiveautomation.com/u/Sawyer_Jones)\
**Post date:** [July 25, 2024, 4:06pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/1 "2024-07-25T16:06:18Z")

</div>

Hello, I'm having trouble finding information on how to edit properties with scripting. I have about 50 labels that need to have their tag binding switched to indirect, select a custom property in the container, and change the device name in the binding.

I know that system.tag.configure can create tags for you, and I guess I was wondering if there was a similar function for perspective properties. Any time I try looking up scripting and perspective properties, I keep getting met with property change scripts, which I might be able to use really creatively, but Iet me know what you guys think.

Anything helps and thank you!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 25, 2024, 4:08pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/2 "2024-07-25T16:08:50Z")

</div>

You cannot edit perspective bindings with scripts from within Ignition. You may be able to automate what you want with ~~`jquery`~~ `jq` _(whoops..)_ outside Ignition, using your view's JSON. (Shift-right-click in the designer tree.)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 25, 2024, 4:16pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/3 "2024-07-25T16:16:47Z")

</div>

> [@pturmel](#):
>
> jquery

Probably meant `jq`, not `jquery` 😄

Unironically the best way I've found to use jq is to give ChatGPT et-al the snippet of JSON I have, describe the transformation I want, and let it give me the arcane snippet I need to achieve the desired result.

---

<div class="post-metadata">

**Author:** ![Sawyer\_Jones](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Sawyer\_Jones](https://forum.inductiveautomation.com/u/Sawyer_Jones)\
**Post date:** [July 25, 2024, 4:21pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/4 "2024-07-25T16:21:35Z")

</div>

I don't know JavaScript nor jq, so I was thinking of plugging the whole thing into Chat GPT lol. I'm open to learning, but I think at this point I should just brute force it. I think I could've gotten done by now. I will definitely experiment with it though. If you have any resources, I would love to have them

---

<div class="post-metadata">

**Author:** ![Sawyer\_Jones](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Sawyer\_Jones](https://forum.inductiveautomation.com/u/Sawyer_Jones)\
**Post date:** [July 25, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/5 "2024-07-25T16:22:53Z")

</div>

Actually, it's a C program not JavaScript my bad

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 25, 2024, 4:23pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/6 "2024-07-25T16:23:25Z")

</div>

An example of a usage of jq applied to Ignition:

> [@How to create / append bulk tooltips via script with json export?](https://forum.inductiveautomation.com/t/how-to-create-append-bulk-tooltips-via-script-with-json-export/50072/4):
>
> You can do it with jq (a downloadable command-line executable designed to manipulate JSON): walk( if type == "object" and .valueSource == "opc" then .tooltip = "TagName: \(.name) \(.opcItemPath)" else . end) [https://jqplay.org/s/Pe6T7qNEFY](https://jqplay.org/s/Pe6T7qNEFY) I mostly copied this snippet from here:

---

<div class="post-metadata">

**Author:** ![tyler.bennett](https://avatars.discourse-cdn.com/v4/letter/t/f04885/32.png) [@tyler.bennett](https://forum.inductiveautomation.com/u/tyler.bennett)\
**Post date:** [July 25, 2024, 4:31pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/7 "2024-07-25T16:31:55Z")

</div>

I've had success copying the view as JSON (shift-right-click, copy json), modifying it in a text editor and pasting it back in.

- Note/Warning: You have to paste your modified JSON back to the containing folder and it will just overwrite without further (any) warning/prompt the view that you copied the JSON from. You could paste to different folder if you like.
- I suggest a healthy knowledge of regular expression find and replace features in your given text editor for this to be efficient (I've been using Notepad++ for regular expression manipulations).

I'd guess the aforementioned [jq](https://jqlang.github.io/jq/) would be a better option but I don't know it (something new to learn I 'spose), I do however know the joy that crafty use of regular expressions can bring to one's soul and thought I mention it as an option.

In any case it might be worthwhile checking your manipulated JSON in a [JSON validator](https://www.google.com/search?q=json+validator) before pasting it back in Ignition.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 25, 2024, 4:54pm UTC](https://forum.inductiveautomation.com/t/changing-perspective-component-properties-with-scripting/93754/8 "2024-07-25T16:54:36Z")

</div>

I consider regex absolutely worth learning, because it's applicable in basically every general purpose language. `jq`'s weird syntax, like `awk`, has not cleared that bar for me personally, because it's only useful when using `jq`. Hence, LLM assistance. It's nice also that `jq`, as long as it works, is ~guaranteed to spit out valid JSON with no funky syntax errors from a missing quote/curly brace/comma. But definitely nothing wrong with the regex approach 🙂
