# Expression split() function "parts" access

**URL:** <https://forum.inductiveautomation.com/t/expression-split-function-parts-access/75342>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 21, 2023, 2:55pm UTC](https://forum.inductiveautomation.com/t/expression-split-function-parts-access/75342 "2023-06-21T14:55:15Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [June 21, 2023, 2:55pm UTC](https://forum.inductiveautomation.com/t/expression-split-function-parts-access/75342/1 "2023-06-21T14:55:15Z")

</div>

I've got a tag with a value like `(1)_123456_V1`. I want to extract `123456` from the tag using an expression tag.

Test 1:  
`split({[.]../PathToTag/Tag}, "_")`  
This returns a dataset and if I set the tag type to Dataset I can view it. The result is,

```auto
parts
  - (1)
  - 123456
  - V1

```

I've tried various combinations to return the second element as a string.

```auto
split({[.]../PathToTag/Tag}, "_")['parts'][1]

```

returns _Error\_TypeConversion_.

Am I close? Can you get me closer?

Thanks.

[https://docs.inductiveautomation.com/display/DOC81/Expression+Language+and+Syntax#ExpressionLanguageandSyntax-DatasetAccess](https://docs.inductiveautomation.com/display/DOC81/Expression+Language+and+Syntax#ExpressionLanguageandSyntax-DatasetAccess)

[https://docs.inductiveautomation.com/display/DOC81/split](https://docs.inductiveautomation.com/display/DOC81/split)

---

<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:** [June 21, 2023, 2:57pm UTC](https://forum.inductiveautomation.com/t/expression-split-function-parts-access/75342/2 "2023-06-21T14:57:31Z")

</div>

It's a dataset. Use `[1, 'parts']` instead of `['parts'][1]`.

(Or just `[1,0]` -- it is always just one column.)

---

<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:** [June 21, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/expression-split-function-parts-access/75342/3 "2023-06-21T15:01:39Z")

</div>

Bingo!  
Thanks Phil.

* * *

"The great thing about standards is that there are so many to choose from."
