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
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive