Onclick Events
I have a simple card with a Table on it where one column that has a HTML link created with a concat function. The link is to call an Azure API and I'm trying to modify the link so that it will call the API silently instead of opening a new tab each time.
I was able to play with an HTML brick and get a Javascript onclick method that worked, but when I tried to migrate that to the card it didn't do anything. It appeared to me that the "onclick" event was simply being ignored, so I simplified it to the following and confirmed that the onclick event is not firing:
concat('<a href="#" onclick="console.log(''test'');">Click Me</a>')
When I click on it, the card tries to filter instead of triggering the console log.
Am I doing something wrong, or is the onclick event ignored in this context?
Best Answer
-
The behavior you're encountering happens because Domo cards are designed to handle data and interactivity in the form of filters rather than custom JavaScript events like onclick. Custom HTML or JavaScript is often sanitized or blocked for security reasons.
Bricks are your best bet for custom scripts, but if you want to call the Azure API on user interaction, consider using Action Buttons or developing a custom app to achieve this.** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0
Answers
-
The behavior you're encountering happens because Domo cards are designed to handle data and interactivity in the form of filters rather than custom JavaScript events like onclick. Custom HTML or JavaScript is often sanitized or blocked for security reasons.
Bricks are your best bet for custom scripts, but if you want to call the Azure API on user interaction, consider using Action Buttons or developing a custom app to achieve this.** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
For reference here's a list of things that are supported in an HTML table. JavaScript isn't supported.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thanks to you both for the response. It seems my options are at least narrowing. I'm still learning Domo so I'm not familiar with Action Buttons. I'll look into those. It seems like that may be my last option. I'm not sure where to start with creating a custom application like this.
0 -
I just tried an HTML table with the onclick event to write the console log and it worked!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive