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
- 10.6K All Categories
- 8 Connect
- 918 Connectors
- 250 Workbench
- 474 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 478 Datasets
- 214 Visualize
- 259 Beast Mode
- 2.1K Charting
- 12 Variables
- 19 Automate
- 356 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 248 Distribute
- 64 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 189 Product Ideas
- 1.2K Ideas Exchange
- 11 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive