Description
The OpenURL
function opens the specified URL in a new or current browser tab/window. However, it must be defined within a button (createButton
) in order to work correctly.
Syntax
OpenURL(url, [sameTab])
Arguments
Argument | Description |
---|---|
url |
The URL to be opened. |
sameTab |
Optional. If sameTab is set to 1 , the URL will be opened in the current tab/window. By default, the URL is opened in a new tab/window. |
Return Types
The function does not return a value; instead, it performs the action of opening the URL.
Examples
Description | Formula |
---|---|
Open a URL with a button |
createButton( 1, "External Resource", "Opens the specified URL in a new tab", "OpenURL('https://example.com')", "", "", "", "The URL was successfully opened.", "", "link" ) Opens the URL |
Open a URL in the current tab |
createButton( 1, "Resource in the same tab", "Opens the URL in the current tab", "OpenURL('https://example.com', 1)", "", "", "", "The URL was successfully opened.", "", "external-link" ) Opens the URL |
Dynamic opening of a project URL |
createButton( 1, "Go to Project", "Opens the current project's URL", "OpenURL('https://example.com/project/' + shortenGUID(projectGuid))", "", "", "", "The project URL was successfully opened.", "", "project" ) Opens the dynamically generated project URL in the browser. |
Notes
- The
OpenURL
function can only be used within a button (createButton
). Otherwise, it will not work. - Use dynamic values like
shortenGUID(projectGuid)
to create project-related URLs. - Ensure that the URL is correct and accessible.
- This function is excellent for buttons that direct users to external resources or internal tools.
Comments
0 comments
Please sign in to leave a comment.