I have a custom workspace and I am trying to update the value of some of the properties (only in the client, hence not the data via the API’s )
Currently I am able to consume the context of UMB_DOCUMENT_WORKSPACE_CONTEXT
and then update the value of any of the properties that currently have a value, but I cannot for the life of me work out how to update the values of any property that does not have a value, as it seems that we are only able to update the items that have some data already.
this.consumeContext(UMB_DOCUMENT_WORKSPACE_CONTEXT, (document) => {
this.#documentWorkspaceContext = document;
this.observe(this.#documentWorkspaceContext.data, (data) => {
if (data) {
console.log('Document data:', data);
this.#currentDocumentData = data;
this.updatePropertyValue('heading', 'Just a little demo of text being updated');
}
});
updatePropertyValue(propertyAlias: string, newValue: any) {
if (!this.#documentWorkspaceContext) return false;
if (this.#currentDocumentData?.values.find(p => p.alias === propertyAlias)) {
if (this.#documentWorkspaceContext.setPropertyValue) {
this.#documentWorkspaceContext.setPropertyValue(propertyAlias, newValue);
return true;
}
}
else {
console.log('Property not found: ' + propertyAlias);
return false;
}
}
If I just try and update one of the properties that does not currently have a value using setPropertyValue
it just fails.
Does anyone have any idea if this is possible, if not, I think it should be