UI API object with methods described below.
Notify the CatalogIQ instance that the app is loaded and ready to get the data. Triggering this method will trigger
the on_app_set_data
event.
Resize the app iframe to a given height.
Note that initial iframe height comes from the app.json
manifest file. It can also be adjusted by the user when adding
app component to the canvas. In case when the app must be temporarily resized to show larger ui elements it can read the
user-set height from the on_app_set_data event.
object containing requested height of the iframe as the number of pixels
Cancels current meeting and the event remains unrealized (like it never happened).
Navigate to the next page in the current canvas. Noop if the current page is the last one.
Navigate to a specific canvas place in the current canvas. Despite the event and parameter name, it takes the component id that we want to put in view.
const uiApi = useUi() // our useApi()
let activeCanvas = null
const unsubscribe = uiApi.on_app_set_data((data) => {
activeCanvas = data?.canvas
})
document.getElementById('my-button').addEventListener('click', () => {
const target = activeCanvas?.content?.data?.find((i: any) => i.data.app_name === 'my-target-app-id') || null
if (target) {
uiApi.canvasNavigatePage({ page: target.id })
}
})
Navigate to the previous page in the current canvas. Noop if the current page is the first one.
Send an app error to Pitcher sentry instance.
error object to send to Pitcher sentry instance
Close the Canvas Section Execution modal. Only takes effect for canvas_section_execution
app modules
Note that this method simply closes the modal and will result in the app calling it being unmounted from the DOM and destroyed. Make sure your app has finished updating data before you call this method.
Completes the postcall stage (with successful submission or not)
Mark the postcall form as not possible to submit by the user. Useful while processing the form data.
This event is used for appJson.module.canvas.start_in_loading_mode: true apps. A loading curtain is displayed until you call this event.
Mark the postcall form as possible to submit by the user.
Opens a modal to view a canvas by ID.
onMounted(() => {
uiApi.openCanvasOverlay({
id: '01HH4RCBH631K4JDHWAQB0RPR6',
edit_mode: false,
fullscreen: true,
})
})
You can also specify a position for the canvas overlay:
uiApi.openCanvasOverlay({
id: '01HH4RCBH631K4JDHWAQB0RPR6',
position: {
top: '10px',
left: '20px',
right: '20px',
bottom: '10px'
}
})
Preselect a meeting in the top meeting bar by Salesforce Meeting ID. From there, the user can easily start the meeting with a single click.
const objectFetchedFromSalesforce = {
// fetch dynamically from Salesforce or provide in another way
EventId: '00U1r00000D1J1zEAF',
}
ui.preselectSfdcMeetingId({ eventId: objectFetchedFromSalesforce.EventId }).then((response) => {
// e.g. display advanced meeting details inside your app
console.log(response.event)
})
Sends a query to the Pitcher Intelligent Assistant (PIA) and handles the streamed response.
// Subscribe to PIA's streamed responses
const cleanup = await useUi().on(
UI_MESSAGE_TYPES.UI_PROMPT_PIA_RESPONSE_STREAMED,
async ({ chunk, partial_response, id }) => {
console.log(`PIA response chunk for stream ${id}: ${chunk}`);
console.log(`PIA response so far for stream ${id}: ${partial_response}`);
}
);
// Prompt PIA with a question and ensure cleanup is called afterwards
useUi().promptPia({ prompt: "What's my most presented file?", id: 'my-prompt-id-to-discern-with-stream-event' })
.finally(cleanup);
Resumes the meeting and attempts to go at the last presented route / component.
Opens the agenda selector modal to allow the user to select agenda content and handle the outcome.
const api = useApi() // or useUi() if you know that you 're in UI context
uiApi.selectAgendaContent({
// optional payload
initial_agenda: {
name: 'test',
groups: []
}
})
Allows the user to select (and preselect) canvases from the instance.
This method allows you to prompt the user to select canvases from the CatalogIQ instance and use that canvas selection in your application.
optional payload to preselect specific canvases
Promise with the user action and selected canvases
const api = useApi() // or useUi() if you know that you 're in UI context
api
.selectCanvases({
allowed_types: ['canvas','canvas-template','section','section-template'] // default ['canvas']
selections: [
{ id: "01HCZ623YYRFJQ0F7B69VWE510" },
{ id: "02HCZ623YYRFJQ0F7B69VWE510" },
], // default []
})
Opens the collection player selector modal to allow the user to select collection player content and handle the outcome.
const api = useApi() // or useUi() if you know that you 're in UI context
uiApi.selectCollectionContent({
// optional payload
initial_data: {
name: 'test',
groups: []
}
})
Allows the user to select (and preselect) content from the instance.
Opens the content selector dialog to allow the user to select content and handle the outcome. This method allows you to prompt the user to select content from the CatalogIQ instance and use that content in your application.
optional payload to preselect specific content
Promise with the user action and selected content
Change the height of the postcall form.
Modify the currently loaded canvas. On the web it sends an update_canvas request to the server.
parts of the canvas object to update with fields to return
Navigate to another page in the CatalogIQ instance.
API methods available in the CatalogIQ default UI.
You can store the API object in a variable and call the methods directly.
Most methods have a
snake_case
andcamelCase
version of their name available.