How to use Escape characters in Beast Modes?
Hi, I am trying to create a web link for a card using a beast mode and some of the values that will be passed through the beast mode contain apostrophes ' . When they are passed through the beast mode the link is broken because the value is cut off early.
For example the value 'Square's Lake' is cut off early and ends up being 'Square' because the second ' makes Domo see it as the end of a value. Note: the first and last ' are what is used to declare a value, for a case statement in this instance.
Is there a way to make note of an Escape Character like ' in a beast mode and ensure that Domo will not see this as the end of a value?
I've seen the doubled ' ' method but that doesn't seem to be working.
Has anyone had experience with this issue or found a way around it?
Answers
-
What does your HTML / beastmode code look like?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
This is the initial version.
CONCAT('<a href=''https://woodpartners.domo.com/page/437192974?pfilters=['
,'{"column":"Comp For","dataType":"string","operand":"IN","values":["'
,`Comp For`
,'"]}'
,']'' target="_blank" title="Open in Domo">','Click here for Weekly Export','</a>'
) end
Domo
[Yesterday 1:23 PM] Bhatia, Ritwik
Not working when our property (value) has an apostrophe (Square's Lake)
I then tried editing in and this is what I ended up with by trying to use an escape character in the name Square's Lake.
case when `Comp For` = 'Square''s Lake' then
CONCAT('<a href=''https://woodpartners.domo.com/page/437192974?pfilters=['
,'{"column":"Comp For","dataType":"string","operand":"IN","values":["'
,'Square''s Lake'
,'"]}'
,']'' target="_blank" title="Open in Domo">','Click here for Weekly Export','</a>'
)
else
CONCAT('<a href=''https://woodpartners.domo.com/page/437192974?pfilters=['
,'{"column":"Comp For","dataType":"string","operand":"IN","values":["'
,`Comp For`
,'"]}'
,']'' target="_blank" title="Open in Domo">','Click here for Weekly Export','</a>'
) end
0 -
I'd try and use some URL encoding for your pfilters value as that's likely what's causing the issues with the quotes not working. You can refer to https://domohelp.domo.com/hc/en-us/articles/360043430113-Sample-Beast-Mode-Calculations-Miscellaneous-Transforms#5.
Also you can use a website to do the URL encoding of your strings like http://urlencoder.org
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 99 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 727 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive