Function backed pivot tables show no grouping or value fields for a new function version on a global branch

Question

I am testing changes across a global branch that contains an Ontology object type update, a typescript v2 functions repo, and a workshop module.

When configuring a function backed pivot Table in Workshop, I can select a newly published branch version of the function. Workshop recognizes the function’s input parameters and lets me map them to variables. However, the selectors for Row groupings, Column grouping, and Values are all empty so I cannot configure the pivot table to test that version.

Example:

  category: string;
  values: {
    previousValue: Double;
    currentValue: Double;
    change: Double;
  };
}

export default async function comparisonPivot(
  client: Client,
  entity: string,
  currentPeriod: string,
  comparisonPeriod: string,
): Promise<ComparisonRow[]> {
  // ...
}

What I’ve verified:

  • The function runs succesfully in preview on the global branch
  • Preview returns populated rows with the expected values
  • Workshop detects the function version and its input parameters
  • The issue is specifically that the pivot table config offers no fields from the function’s output
  • If I develop the function on a code repository branch, merge it to main, and select the main-branch version in Workshop, the grouping and value fields appear and the pivot table works as expected

This seems specific to testing a function backed pivot table with a function version published on a global branch, rather than the function’s return type.

Is there a way to make Workshop discover the branch version’s output fields before merging? Is there an additional publication step required, or is it a known limitation?

@RTAN

a few things worth checking before calling it a limitation, the branching docs don’t list pivot tables as unsupported:

  • TSv2 on a global branch needs the typescript-functions parent template at 0.1299.0 or higher plus a local Ontology SDK enabled. without the local SDK the repo can reference a branch version but can’t build against the branched schema, which could leave Workshop without the output type
  • in the function selector make sure you picked the version tagged “Branched pre-release” for your version target, not an older one
  • the pivot docs declare the row type with interface (export interface ComparisonRow { … }) and need a field named values. if ComparisonRow is a type alias, try switching it to an interface and republish

if all three check out and main still works while the branch doesn’t, I’d raise it with support as a bug with the function rid and the branch version, since preview returning rows shows the function itself is fine