# Perspective Properties - Value error

**URL:** <https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [August 23, 2023, 7:27am UTC](https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272 "2023-08-23T07:27:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudhanthiralakshmi\_M](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@Sudhanthiralakshmi\_M](https://forum.inductiveautomation.com/u/Sudhanthiralakshmi_M)\
**Post date:** [August 23, 2023, 7:27am UTC](https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272/1 "2023-08-23T07:27:12Z")

</div>

I got this caution while binding a query to this property. As I binded the expected datatype "Integer". But it is showing the expected error "string found" . how to resolve this

 ![value error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c811eff6ed8ed216c802bfc6c2bf475dc08bedfa.jpeg)

---

<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:** [August 23, 2023, 7:39am UTC](https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272/2 "2023-08-23T07:39:27Z")

</div>

Show us your binding. (If it's an expression then please post \</\> formatted code rather than a picture of code.)

---

<div class="post-metadata">

**Author:** ![Sudhanthiralakshmi\_M](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@Sudhanthiralakshmi\_M](https://forum.inductiveautomation.com/u/Sudhanthiralakshmi_M)\
**Post date:** [August 23, 2023, 7:44am UTC](https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272/3 "2023-08-23T07:44:36Z")

</div>

Its a Query Binding

```auto
Select Top 1 PF from Main WHERE BG =:bg and Plant =:pl and Line=:ll and Machine =:ma and
Date between :st and :sp
order by Date desc

```

```auto
[
  {
    "type": "ia.chart.simple-gauge",
    "version": 0,
    "props": {
      "minValue": -2,
      "maxValue": 1,
      "startAngle": 0,
      "arc": {
        "color": "#008000"
      },
      "arcBackground": {
        "color": "#008000"
      },
      "label": {
        "visible": false
      },
      "animate": true,
      "style": {
        "classes": []
      }
    },
    "meta": {
      "name": "SimpleGauge"
    },
    "position": {
      "basis": "300px"
    },
    "custom": {},
    "propConfig": {
      "props.value": {
        "binding": {
          "type": "query",
          "config": {
            "returnFormat": "scalar",
            "queryPath": "Online_PF",
            "parameters": {
              "ll": "{..../Line_Dropdown.props.value}",
              "st": "{..../DateTimeInput.props.value}",
              "ma": "{..../Machine_Dropdown.props.value}",
              "bg": "{view.params.BG}",
              "pl": "{view.params.Plant}",
              "sp": "dateArithmetic({..../DateTimeInput.props.value}, 1, \"days\")"
            }
          }
        }
      }
    }
  }
]

```

---

<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:** [August 23, 2023, 7:51am UTC](https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272/4 "2023-08-23T07:51:02Z")

</div>

What data type is the database field PF? If it's a string or text then that's probably your problem.  
I can reproduce the error by creating an expression binding with the simple expression `"-0.99"` which, of course, is a string.

If you can't fix the DB then try adding an expression transform on the binding.  
`toFloat({value})`

---

<div class="post-metadata">

**Author:** ![Sudhanthiralakshmi\_M](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@Sudhanthiralakshmi\_M](https://forum.inductiveautomation.com/u/Sudhanthiralakshmi_M)\
**Post date:** [August 23, 2023, 8:36am UTC](https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272/5 "2023-08-23T08:36:37Z")

</div>

Thanks for the suggestions.I have added the Expression transform. Now it works well.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 23, 2023, 11:02am UTC](https://forum.inductiveautomation.com/t/perspective-properties-value-error/78272/6 "2023-08-23T11:02:43Z")

</div>

Or change the query, which would be a touch more performant:

```sql
SELECT Top 1 CAST(PF as float)
FROM Main 
WHERE BG =:bg 
   AND Plant =:pl 
   AND Line=:ll  
   AND Machine =:ma
   AND Date BETWEEN :st AND :sp
ORDER BY Date DESC
```
