Share Links Functions

These functions are available with the <sharebutton>

GetShareLinkForCurrentView

GetShareLinkForCurrentView

No parameters

Returns a shared link URL for the current view. The same output that is copied to the clipboard when a user clicks the <sharebutton/>

Example

Copy Code

<script>
    const sharedUrl = BoardScript.GetShareLinkForCurrentView();
    console.log('The sharable URL is ', sharedUrl);
</script>
            

GetShareLink

Get the share link for an arbitrary board view/record.

GetShareLink

args

object

Single parameter object for specifying board/view/dataid/incident.

Copy Code

{
    boardName?: string;      // Name of the board. Defaults to the current board.
    viewName?: string;       // Name of the view within the board. Defaults to the current view.
    dataId?: number;         // Record ID for a record-specific link.
                            // When provided, incidentName is ignored and the incident
                            // is resolved from the record at link-open time.
                            // When omitted, produces a list view link.
    incidentName?: string;   // Incident name for a list view link.
                        // Ignored if dataId is provided or the board is incident-independent.
                        // When omitted, defaults to the user's current session incident.

            

callback

#optional

Result can be received via callback or async/await Promise return.

returns object
Copy Code

{
    url: URL | null;          // The shareable link. Null if creation failed.
    error: string | null;   // Human-readable error message if creation failed, otherwise null.
                            // Possible causes: board/view not found, permission denied,
                            // incident not found, HTTP error.
}
                            

Example

Copy Code

<script>
    const args =  {
        boardName: "My Board",
        viewName: "My List View",
        incidentName: "My Incident"
    };

    // callback
    BoardScript.GetShareLink(args, function (result) {
        console.log('Url is:', result.url);
        console.log('Error is:', result.url); 
    });
 
    // async/await
    const result = await BoardScript.GetShareLink(args);
    console.log('Url is:', result.url);
    console.log('Error is:', result.url);     
</script>