We have a requirement to use Spreading on UX, however, the users would like to capture all the spreading steps that they did, and also they want to capture comments for each action.
It sounds to be a reasonable request, but “is it possible?”
So the idea is like:
Function 1: Integrate with “Annotation” function, so when spreading, also do an annotation.
Function 2: Option to integrate a TI process to capture the comment to another cube.
I’m not sure if I understand this correctly, but let me try to offer my 2 cents first: the spreading functionality in UX currently may not have the capability to add annotations (not sure if the latest generation version includes this feature). However, if you open Table Config - Functions, you’ll find four types of API call positions that might be helpful. UX can dynamically capture the target cell range affected by the user’s operation by listening to events such as After Cell Update or After Table Update.
For option 2, you probably need to capture the user’s comment and trigger the TI process from the frontend.
const instanceName = "tm1_instance";
const processName = "YourTIProcessName";
const parameters = {
pDimension1: "Value1",
pDimension2: "Value2",
pDimension3: "Value3",
pComment: "User entered comment",
pAction: "Spread value from Q1 to Q4"
};
// Prompt User for Comment
const userComment = prompt("Please enter your comment for this action:");
if (userComment) {
parameters.pComment = userComment;
}
// Execute the TI Process
$tm1Ui.processExecute(instanceName, processName, parameters).then((response) => {
if (response.success) {
console.log("TI Process executed successfully!");
} else {
console.error("Failed to execute TI process:", response.message);
}
});