Target filter
Search Kotlin docs
  • Back
  • Tealium Prism Kotlin SDK Reference
core/com.tealium.prism.core.api.data/DataObject/buildPath

buildPath

fun buildPath(path: JsonObjectPath, item: DataItem): DataObject

Takes a copy of this DataObject and builds the necessary path according to the given path in order to store the given item.

Where a DataObject/DataList already exists on the given path, the incoming items will be merged in. Where the DataObject/DataList does not exist yet in this DataObject a new one will be created. Where a different type was specified on the path to what is currently in this DataObject, it will be overwritten. Writing to an index that already exists in a DataList replaces the element at that index instead of inserting, so the following elements are not shifted. An index beyond the end of the list pads it with DataItem.NULL.

Return

a new DataObject with the item stored at the given path

Parameters

path

the JsonObjectPath used to describe where to store item

item

the DataItem to add

Generated by Dokka
(c) Tealium 2026