# Can I change the value of a specific column in the dataset and show it?

**URL:** <https://forum.inductiveautomation.com/t/can-i-change-the-value-of-a-specific-column-in-the-dataset-and-show-it/74324>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 31, 2023, 12:59am UTC](https://forum.inductiveautomation.com/t/can-i-change-the-value-of-a-specific-column-in-the-dataset-and-show-it/74324 "2023-05-31T00:59:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KIM\_JINGEUN](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@KIM\_JINGEUN](https://forum.inductiveautomation.com/u/KIM_JINGEUN)\
**Post date:** [May 31, 2023, 12:59am UTC](https://forum.inductiveautomation.com/t/can-i-change-the-value-of-a-specific-column-in-the-dataset-and-show-it/74324/1 "2023-05-31T00:59:25Z")

</div>

Hello!  
I have a few questions.  
This is the dataset retrieved from sql.  
I want to show the value of a specific column in this table as a value of a different type.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/c/4c4c19bb23818aa2481fdad04371bf3b3bdb38d0.png)  
For example, if the value of 'event ID' column is '1', I want to show it as 'inspection'.  
thanks for your advice.

---

<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:** [May 31, 2023, 1:07am UTC](https://forum.inductiveautomation.com/t/can-i-change-the-value-of-a-specific-column-in-the-dataset-and-show-it/74324/2 "2023-05-31T01:07:41Z")

</div>

No, not simply. Dataset columns have a datatype--if the DB delivers numbers, any single updated value would also have to be number. You can get around this by replacing the entire column with strings, though.

Note, however, that if the table source data is a **binding** , then the next update will wipe out any changes you make in place. The typical solution to this varies by UI type:

- In Perspective, you would add a transform to the binding to perform the substitution before delivery to the target property.

- In Vision, you would move the binding to a custom property of the component and use an expression binding, perhaps with runScript(), to perform the necessary transform.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [May 31, 2023, 4:00am UTC](https://forum.inductiveautomation.com/t/can-i-change-the-value-of-a-specific-column-in-the-dataset-and-show-it/74324/3 "2023-05-31T04:00:19Z")

</div>

> [@KIM\_JINGEUN](#):
>
> if the value of 'event ID' column is '1', I want to show it as 'inspection'.

It would probably be easiest to simply do the transformation in the SQL query itself using [the CASE function](https://www.w3schools.com/sql/func_mysql_case.asp).

**Example:**

```auto
SELECT Model, Cabinet, Id, evtDate,
	CASE eventID
		WHEN 1 THEN 'inspection'
		WHEN 2 THEN 'packing'
		WHEN 3 THEN 'shipping'
		ELSE 'unknown'
	END AS eventDescription, evtStatus
FROM
	#[...]
WHERE
	#[...];

```

---

<div class="post-metadata">

**Author:** ![KIM\_JINGEUN](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@KIM\_JINGEUN](https://forum.inductiveautomation.com/u/KIM_JINGEUN)\
**Post date:** [May 31, 2023, 5:53am UTC](https://forum.inductiveautomation.com/t/can-i-change-the-value-of-a-specific-column-in-the-dataset-and-show-it/74324/4 "2023-05-31T05:53:41Z")

</div>

thanks for your advice.

---

<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:** [May 31, 2023, 7:01am UTC](https://forum.inductiveautomation.com/t/can-i-change-the-value-of-a-specific-column-in-the-dataset-and-show-it/74324/5 "2023-05-31T07:01:45Z")

</div>

Or store the events names in another table and reference it in the query with a join, something like

```sql
SELECT ..., event_name
FROM your_table
INNER JOIN event_names
    ON your_table.evtID = event_names.id

```
