Hi Adam,
thank you very much!
This is exactly the information I needed. The format you describe is also the format that has to be sent as eventPayload if you want to communicate with the embedded PAW book.
I also found the following format when debugging the PAW UI API code:
{
"alias": "someAlias",
"defaultMember": null,
"hierarchyID": "[dim1].[hier1]",
"isNamedSet": false,
"memberID": "[dim1].[hier1].[ElementA]",
"memberSet":"{[dim1].[hier1].[ElementA]}",
"Private": false,
"serverName": "TM1DBName"
}
This allowed me to change the alias used in the book, for example.
The corresponding code for sending the message to the book is as follows (iFrame is the HTMLElement that embeds the book):
iFrame.contentWindow.postMessage(
{
'type': 'execute',
'eventName': 'sync',
'eventPayload': {
'book': [
{
"alias": "someAlias",
"defaultMember": null,
"hierarchyID": "[dim1].[hier1]",
"isNamedSet": false,
"memberID": "[dim1].[hier1].[ElementA]",
"memberSet":"{[dim1].[hier1].[ElementA]}",
"Private": false,
"serverName": "TM1DBName"
}
]
}
}
);
------------------------------
Christoph Heinzen
Virtivity GmbH
Hamburg
------------------------------
Original Message:
Sent: Wed April 17, 2024 06:03 PM
From: Adam Havas
Subject: PAW UI API - Sending/Receiving messages
Hi Christoph,
Happy to help you with the synchronization aspect of your first question as I've recently come across it myself. Though it's called Synchronization, in my mind the use case is being able to create URLs to books with filtering all within the URL.
Below is an illustrative example of how it works.
- I've added newlines for clarity, but this all a single line URL.
- "book" corresponds to synchronization group names. Don't forget to turn on synchronization for widgets you'd like to control in this way.
- You can add multiple synchronization groups and have more than two dimensions you're filtering on.
https://PlanningAnalyticsWorkspaceDomain/ui?type=book&path=/shared/Folder_Name/Book_Name#Synchronization={"book":[ {"serverName":"TM1DBName","hierarchyID":"[dim1].[hier1]","memberSet":"{[dim1].[hier1].[ElementA]}"}, {"serverName":"TM1DBName","hierarchyID":"[dim2].[hier2]","memberSet":"{[dim2].[hier2].[ElementB]}"}]}
In this example, Book_Name is opened and all widgets that have "book" as the synchronization group, dim1 will be filtered on ElementA and dim2 will be filtered on ElementB.
Hope this helps.
------------------------------
Adam
------------------------------