Expression split() function "parts" access

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,

parts
  - (1)
  - 123456
  - V1

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

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/split

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

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

3 Likes

Bingo!
Thanks Phil.


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