Referencing Time Series in Object creation/update using Typescript V2 Function

Hello!

I’m creating a Function using TypeScript V2 and I want to upsert objects of a type CustomTimeSeries, which has a property called timeSeriesId of type TimeSeries.

In the UI, I can update the related timeSeriesId via Actions and point it to a new time series, but I haven’t found a way to do this inside a Function.

The problem is:

  • The property timeSeriesId does not accept a string.

  • If I try to assign a different value to reference a time series, the compiler complains that it’s not of type TimeSeriesProperty<number>.

  • However, TimeSeriesProperty<number> only exposes methods for accessing datapoints—it doesn’t seem to represent a reference to an existing time series.

I’d like to know:

  1. How can I reference or assign a time series to a TimeSeriesProperty inside a TypeScript V2 Function?

  2. Is there a supported way to do this without inserting datapoints?

  3. Are there any examples or documentation on how to handle time series references in functions?

Thanks in advance for any guidance!