Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ function callerAddress(invocation: CustomFunctions.Invocation) {
return invocation.address;
}

function isInValuePreview(invocation: CustomFunctions.Invocation) {
return invocation.isInValuePreview;
}

async function getStockValues(ticker: string): Promise<number> {
const response = await fetch(`myService.com/prices/${ticker}`);
return (await response.json())["price"];
Expand Down
10 changes: 10 additions & 0 deletions types/custom-functions-runtime/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ declare namespace CustomFunctions {
* [Api set: CustomFunctionsRuntime 1.3]
*/
parameterAddresses?: string[];

/**
* Indicates whether the function is invoked as part of the formula value preview.
* `isInValuePreview` is read-only and can't be set by a custom functions add-in.
* This value is `true` if the function is invoked to preview the formula value; otherwise it is `false`.
*
* @remarks
* [Api set: CustomFunctionsRuntime 1.5]
*/
isInValuePreview?: string;
}

/**
Expand Down