From 80eecfce7c800e44c7c5fbd06d3ea110f7be0e6d Mon Sep 17 00:00:00 2001 From: Rani Gangwar Date: Wed, 5 Nov 2025 14:33:45 +0530 Subject: [PATCH 1/6] updates1 --- .../ROOT/pages/code-based-custom-actions.adoc | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/pages/code-based-custom-actions.adoc b/modules/ROOT/pages/code-based-custom-actions.adoc index 7dd9e8b18..0a9f5d85e 100644 --- a/modules/ROOT/pages/code-based-custom-actions.adoc +++ b/modules/ROOT/pages/code-based-custom-actions.adoc @@ -445,4 +445,23 @@ const customActions = [{ groupId: ['grp1'], orgId: ['org1'] }, ]; ----- \ No newline at end of file +---- + +[NOTE] +`modelColumnNames` are not currently supported for code based custom action for Spotter. + +=== Add callback to a custom action + +To add a callback to a custom action when it is clicked, use the Visual Embed SDK's .on method with EmbedEvent.CustomAction. + +[source,javascript] +---- +embed.on(EmbedEvent.CustomAction, (payload) => { + if (payload.data.id === 'your-custom-action-id') { + // Your callback logic + console.log("Custom Action event:", payload.data); + } +}); +---- + +Ensure you have created the custom action and noted its id. In your callback, verify the action id in the payload. \ No newline at end of file From f8ed45a2f046606c5bf825ba6a9884af90e52d04 Mon Sep 17 00:00:00 2001 From: Rani Gangwar Date: Wed, 5 Nov 2025 14:50:37 +0530 Subject: [PATCH 2/6] updates2 --- modules/ROOT/pages/code-based-custom-actions.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/code-based-custom-actions.adoc b/modules/ROOT/pages/code-based-custom-actions.adoc index 0a9f5d85e..5f19f921a 100644 --- a/modules/ROOT/pages/code-based-custom-actions.adoc +++ b/modules/ROOT/pages/code-based-custom-actions.adoc @@ -450,7 +450,7 @@ const customActions = [{ [NOTE] `modelColumnNames` are not currently supported for code based custom action for Spotter. -=== Add callback to a custom action +=== Add callback to a code based custom action To add a callback to a custom action when it is clicked, use the Visual Embed SDK's .on method with EmbedEvent.CustomAction. From aca67223e785b723c9fbca64b7fb7ca075e81e34 Mon Sep 17 00:00:00 2001 From: Rani Gangwar Date: Wed, 5 Nov 2025 15:54:01 +0530 Subject: [PATCH 3/6] updates3 --- modules/ROOT/pages/code-based-custom-actions.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/code-based-custom-actions.adoc b/modules/ROOT/pages/code-based-custom-actions.adoc index 5f19f921a..6011a8735 100644 --- a/modules/ROOT/pages/code-based-custom-actions.adoc +++ b/modules/ROOT/pages/code-based-custom-actions.adoc @@ -432,6 +432,9 @@ In this example, for a user who is part of org1 and grp1, * The custom action will also be shown in any Liveboard where these answers have been pinned. +[NOTE] +`modelColumnNames` are not currently supported for code based custom action for Spotter. + [source,javascript] ---- const customActions = [{ @@ -447,12 +450,10 @@ const customActions = [{ }, ]; ---- -[NOTE] -`modelColumnNames` are not currently supported for code based custom action for Spotter. === Add callback to a code based custom action -To add a callback to a custom action when it is clicked, use the Visual Embed SDK's .on method with EmbedEvent.CustomAction. +To add an event handler to listen to the callback event and trigger a data payload as a response when a user clicks on the code based custom action, use the Visual Embed SDK's .on method with EmbedEvent.CustomAction. [source,javascript] ---- From a9165a7429a5b3b096a9045ec49cd8b1fbe4b1a3 Mon Sep 17 00:00:00 2001 From: Rani Gangwar Date: Thu, 6 Nov 2025 12:51:21 +0530 Subject: [PATCH 4/6] updates4 --- modules/ROOT/pages/code-based-custom-actions.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ROOT/pages/code-based-custom-actions.adoc b/modules/ROOT/pages/code-based-custom-actions.adoc index 6011a8735..233130cd3 100644 --- a/modules/ROOT/pages/code-based-custom-actions.adoc +++ b/modules/ROOT/pages/code-based-custom-actions.adoc @@ -69,6 +69,9 @@ Custom Actions can be embedded through the Visual Embed SDK in the following two === Code based custom action for Liveboards +[NOTE] +Code based custom action for Liveboards do not return data in their callback. To get data from a Liveboard object and its visualizations use the `POST /api/rest/2.0/metadata/liveboard/data` API endpoint. + The custom action is applied to all Liveboards. [source,javascript] From 657dff2b94aeaf78c70e240feff6ce15c83ca537 Mon Sep 17 00:00:00 2001 From: Rani Gangwar Date: Thu, 6 Nov 2025 13:08:55 +0530 Subject: [PATCH 5/6] updates5 --- modules/ROOT/pages/code-based-custom-actions.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/code-based-custom-actions.adoc b/modules/ROOT/pages/code-based-custom-actions.adoc index 233130cd3..f26ffc4d8 100644 --- a/modules/ROOT/pages/code-based-custom-actions.adoc +++ b/modules/ROOT/pages/code-based-custom-actions.adoc @@ -70,7 +70,7 @@ Custom Actions can be embedded through the Visual Embed SDK in the following two === Code based custom action for Liveboards [NOTE] -Code based custom action for Liveboards do not return data in their callback. To get data from a Liveboard object and its visualizations use the `POST /api/rest/2.0/metadata/liveboard/data` API endpoint. +Code based custom action for Liveboards do not return data for visualizations in their callback. To get data from a Liveboard object and its visualizations use the `POST /api/rest/2.0/metadata/liveboard/data` API endpoint. The custom action is applied to all Liveboards. From 64ff432b3a1a60ae63876d63fa4ec954b160cb3f Mon Sep 17 00:00:00 2001 From: Rani Gangwar Date: Mon, 10 Nov 2025 19:02:18 +0530 Subject: [PATCH 6/6] updates-final --- modules/ROOT/pages/code-based-custom-actions.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ROOT/pages/code-based-custom-actions.adoc b/modules/ROOT/pages/code-based-custom-actions.adoc index f26ffc4d8..10b579b85 100644 --- a/modules/ROOT/pages/code-based-custom-actions.adoc +++ b/modules/ROOT/pages/code-based-custom-actions.adoc @@ -209,6 +209,8 @@ const customActions = [{ }, ]; ---- + +//// When the answerId parameter is provided, the system displays custom actions only on the visualization(s) that use the specified underlying answerId. In this example, consider a Liveboard (lb1) with three visualizations: viz1 (based on ans1), viz2 (based on ans2), and viz3 (based on ans3). @@ -232,6 +234,8 @@ const customActions = [{ }, ]; ---- +//// + When `modelIds` is passed in the `dataModelIds`, then the custom action is show for all visualization which are using the columns of the specified model.