monday.execute

You can use the monday.execute software development kit (SDK) method to invoke an action on the parent monday client.

Parameters

ParameterDescription
typeWhich action to perform.
paramsOptional parameters for the action.

Actions

Open item card

Opens a modal with information from the selected item

type openItemCard

ParameterTypeDescriptionRequiredDefault Value
itemIdIntegerThe ID of the item to open.Yes
kindStringOn which view to open the item card.
Can be "updates" / "columns"
No"columns"

Example

monday.execute('openItemCard', { itemId: item.id });

Here's what the open item card will look like:

Confirmation dialog

Opens a confirmation dialog to the user type confirm

ParameterTypeDescriptionRequiredDefault Value
messageStringThe message to display in the dialogYes
confirmButtonStringThe text for the confirmation buttonNo"OK"
cancelButtonStringThe text for the cancel buttonNo"Cancel"
excludeCancelButtonBooleanEither to exclude the cancel buttonNofalse

Example

monday.execute("confirm", {
   message: "Are you sure?", 
   confirmButton: "Let's go!", 
   cancelButton: "No way", 
   excludeCancelButton: false
}).then((res) => {
    console.log(res.data);
    // {"confirm": true}
});

Here's what the confirmation dialog will look like:

Notice message

Display a message at the top of the user's page. Useful for success, error & general messages.

type notice

ParameterTypeDescriptionRequiredDefault Value
messageStringThe message to display.Yes
typeStringThe type of message to display. Can be "success" (green), "error" (red) or "info" (blue).No"info"
timeoutIntegerThe number of milliseconds to show the message until it closes.No5000

Example

monday.execute("notice", { 
   message: "I'm a success message",
   type: "success", // or "error" (red), or "info" (blue)
   timeout: 10000,
});

This is what the success message will look like:

Open files preview dialog

Opens a modal with the preview of an asset

type openFilesDialog

ParameterTypeDescriptionRequiredDefault Value
boardIdIntegerThe ID of the board.Yes
itemIdIntegerThe ID of the item, which contains an asset.Yes
columnIdStringThe ID of the column, which contains an asset.Yes
assetIdIntegerThe ID of the asset to open.Yes

Example

monday.execute('openFilesDialog', {
  boardId: 12345,
  itemId: 23456,
  columnId: 'files',
  assetId: 34567
})

Opening the file preview dialog will look like this:

Trigger file upload process

Opens a modal to let the current user upload a file to a specific file column.

Returns a promise. In case of error, the promise is rejected.

After the file is successfully uploaded, the "change_column_value" event will be triggered. See the monday.listen('events', callback) method to subscribe to these events.

Requires boards:write scope

type triggerFilesUpload

ParameterTypeDescriptionRequiredDefault Value
boardIdIntegerThe ID of the board.Yes
itemIdIntegerThe ID of the item, which contains an asset.Yes
columnIdStringThe ID of the file column, where file should be uploaded.Yes

Example

monday.execute('triggerFilesUpload', {
  boardId: 12345,
  itemId: 23456,
  columnId: 'files'
})

Triggering the file upload process will look like this:

Open modal

Opens a new modal window as an iFrame.

type openAppFeatureModal

ParameterTypeDescriptionRequiredDefault Value
urlStringThe URL of the page displayed in the modal.No
urlPathStringSubdirectory or path of the URL to open.No
urlParamsObjectQuery parameters for the URL.No
widthStringThe width of the modal.No"0px"
heightStringThe height of the modal.No"0px"

Example

monday.execute('openAppFeatureModal', { urlPath, urlParams, height, width }).then((res) => {
   console.log(res.data);
   {"close": true}
   // The above is a callback to see if a user closed the modal from the inside. This is useful should you want to run some logic within the app window. 
});

Opening and closing a modal will look like this:

📘

Note

Make sure the urlPath you pass is a relative URL and not an absolute URL.

Close modal

Closes the modal window.

type closeAppFeatureModal

This method does not have any parameters.

Example

monday.execute('closeAppFeatureModal').then((res) => {
  console.log(res.data);
});

Value created for user

Notifies the monday platform that user gains a first value in an app. You can find more information about this method in the Value-created event best practices doc.

type value

This method does not have any parameters.

Example

monday.execute('valueCreatedForUser');

Open setting window

Opens view settings window.

type value

This method does not have any parameters.

Example

monday.execute('openSettings').then((res) => {
  console.log(res.data);
  // note that method will open view settings, unless settings were already opened
});

This is what opening and closing settings looks like:

Close setting window

Closes view settings window.

type value

This method does not have any parameters.

Example

monday.execute('closeSettings').then((res) => {
  console.log(res.data);
  // note that method will close view settings, unless settings were already closed
});