Slight correction of the above and addition on “how to load object sets from workshop” to alleviate the previous 10k limit: https://community.palantir.com/t/how-to-pass-an-object-set-from-workshop-to-a-custom-react-widget/4447
This util function now supports string properly (there was a bug where it was adding quotes in the previous version shared):
// ========= Utils functions =========
// Loads the value from the Workshop context. It will validate the value is present and has been loaded.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getValueFromAsyncValue = (asyncVal: IAsyncValue<any> | undefined) => {
if (asyncVal != null && isAsyncValue_Loaded(asyncVal)) {
const value = asyncVal.value;
if (typeof value === "string") {
return value; // return string as-is, no extra quotes
}
return JSON.stringify(value); // stringify non-string values
}
return undefined;
};