1

The schema shows that a field is a "system.string" and it has a variable number of elements, like a list of lists. What I would like to do is convert this into a normal string and store that in a field. Just tostring() does not cut it. It is like I have to unpack and then concatenate. How can I do this? You could reference each element with Tags[0], Tags[1].... but there is a variable number of indexes.

example: How can one expland MoreData into a flat string?

datatable(Date:datetime, Event:string, MoreData:dynamic) [
datetime(1910-06-11), "Born", dynamic(["value5", "value6"]),
datetime(1930-01-01), "Enters Ecole Navale", dynamic(["value5", "value6"]),
datetime(1953-01-01), "Published first book", dynamic(["value5", "value6"]),
datetime(1997-06-25), "Died", dynamic(["value5", "value6"]),
]

Suppose you wanted to generate a result of '"value5", "value6"' as a string?

user8369515
  • 485
  • 1
  • 5
  • 16

1 Answers1

1
datatable(Date:datetime, Event:string, MoreData:dynamic) [
datetime(1910-06-11), "Born", dynamic(["value5", "value6"]),
datetime(1930-01-01), "Enters Ecole Navale", dynamic(["value5", "value6"]),
datetime(1953-01-01), "Published first book", dynamic(["value5", "value6"]),
datetime(1997-06-25), "Died", dynamic(["value5", "value6"]),
]
| extend result = array_strcat(MoreData,',')
Date Event MoreData result
1910-06-11T00:00:00Z Born ["value5","value6"] value5,value6
1930-01-01T00:00:00Z Enters Ecole Navale ["value5","value6"] value5,value6
1953-01-01T00:00:00Z Published first book ["value5","value6"] value5,value6
1997-06-25T00:00:00Z Died ["value5","value6"] value5,value6

Fiddle

David דודו Markovitz
  • 42,900
  • 6
  • 64
  • 88