There are 3 issues with the concat
and encode_uri
formulas when it comes to creating links/buttons.
Details below, but here’s the summary:
encode_uri
truncates any content that follows a line ending with a comma- in
if
formula, if the success output is a link/button, it’ll be formatted as text only.
The data
I have a row with person Name
, Email
, a Payment link
, and I want to generate a fully populated mailto link/button.
Here’s some example data:
Name: Alice
Email: alice@example.com
Payment link: https://buy.stripe.com/some_id
Here’s my formula:
button(
encode_uri(
concat(
"mailto:", field('Email'), "?subject=Welcome to the AVID network!&body=",
concat(
"Dear ", field('Name'), "
Please submit your payment via this link:
",
get_link_url(field('Payment link')), "
Regards
The team"
)
)
),
"Send email"
)
Comma issue
In the above formula, if I modify the formula to:
...
"Dear ", field('Name'), ",
Please submit your payment via this link:
...
or
...
Regards,
The team"
...
the resulting mailto will truncate anything that follows the comma, including the comma.
If formula
Wrapping the link/button in an if
formula will break the formatting.
If I have if(condition=True, button(..., "Send email"), '')
, the output will be just the “Send email” text, without any link/action.