# Setting tag value from a dictionary

**URL:** <https://forum.inductiveautomation.com/t/setting-tag-value-from-a-dictionary/50961>\
**Category:** Ignition\
**Created:** [September 14, 2021, 3:57pm UTC](https://forum.inductiveautomation.com/t/setting-tag-value-from-a-dictionary/50961 "2021-09-14T15:57:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [September 14, 2021, 3:57pm UTC](https://forum.inductiveautomation.com/t/setting-tag-value-from-a-dictionary/50961/1 "2021-09-14T15:57:38Z")

</div>

Instructions said to make a new post when I went to add more help I needed on a thread.

I am trying to get a string location from a dictionary to be set as the value for a tag.  
I attempted the following in the tag scripting.

```auto
temp = system.tag.readBlocking(["[.]../../Equipment_State"])[0]
	
temp2=machine1.get_errorlocation(temp) 	
	
system.tag.writeBlocking(["[.]Machine1 Error Location"],[temp2])

```

I am able to write the correct equipment state to the tag using this code below.  
I verified this code works:

```auto
temp = system.tag.readBlocking(["[.]../../Equipment_State"])[0]
system.tag.writeBlocking(["[.]Machine1 Error Location"],[temp])

```

I verified in a binding script that the below code works in the binding section of an object on perspective

```auto
value=machine1.get_errorlocation(value) 
return value

```

For some reason though, I can’t get the value from the dictionary to become the value of the tag value.

for reference, here is what I had been working on  
[Mapping a tag output from 1000 input values - Ignition - Inductive Automation Forum](https://forum.inductiveautomation.com/t/mapping-a-tag-output-from-1000-input-values/46483)

---

<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:** [September 14, 2021, 5:36pm UTC](https://forum.inductiveautomation.com/t/setting-tag-value-from-a-dictionary/50961/2 "2021-09-14T17:36:35Z")

</div>

Your `temp` variable is not the tag value, but a qualified value object. Those are allowed when writing to tags, which is why your two-line action works. Pass `temp.value` to your lookup script.

Also take a look at the docs for readBlocking where it describes the return value.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [September 14, 2021, 6:09pm UTC](https://forum.inductiveautomation.com/t/setting-tag-value-from-a-dictionary/50961/3 "2021-09-14T18:09:35Z")

</div>

Thanks
