Hyperlink not working

In a email body of an automated bot, I created a LINKTOFILTEREDVIEW that is working.

https://www.appsheet.com/start/12345678-9101112-1314-1516-123456789012<<LINKTOFILTEREDVIEW(view name, ([Id] = [_THISROW].[id]))>>

Now I would like to enter that into a HYPERLINK, this is how I entered it and it’s not working.

<<HYPERLINK("https://www.appsheet.com/start/12345678-9101112-1314-1516-123456789012<<LINKTOFILTEREDVIEW(view name, ([Id] = [_THISROW].[id]))>>", "Text to display!")>>

Does anyone know why it isn’t working?

I just tried a concatenate() function as well and now the link it’s working, but it’s not replacing the link for the text:

<<HYPERLINK(
    Concatenate(
            "https://www.appsheet.com/start/12345678-9101112-1314-1516-123456789012", 
            LINKTOFILTEREDVIEW(view name, ([Id] = [_THISROW].[id]))
                ) 
            , "text!"
            )>>

You likely need to use HTML mark-up rather than AppSheet’s HYPERLINK function, which probably governs rendering only within an app. Something like:

<a href="http://<<Concatenate("https://www.appsheet.com/start/12345678-9101112-1314-1516-123456789012", LINKTOFILTEREDVIEW(view name, ([Id] = [_THISROW].[id])))>>">text!</a>
4 Likes

@dbaum It didn’t work as expected. Did you mean to have that http:// at the beginning? Anyhow, i tried without it and still didn’t work. I might have to just render the email from an HTML file directly. I get all kind of issues when trying to write these kind of expressions in directly in appsheet.

When I replied, I didn’t try or test anything–I only copied your existing expression into an HTML editor to create a sample for you. I see now that I somehow ended up repeating “http://”, which surely is incorrect.

I did just review some Send an email tasks in my own apps, and indeed they include:

<a href="http://...

However, I didn’t find any that use an expression to generate the hyperlink. So, I don’t have any examples that use either of the following:

...<<Concatenate("...

...<<Concatenate("...

Yes, I often find it finicky.

1 Like

Thanks for your response to this post. I have never quite understood the construction of links for emails nor when to encode and when its not needed.

Following your suggested HTML coding I get this:

<a href="http://<<CONCATENATE("https://www.appsheet.com/start/a5910859-fda5-445d-8d3c-48bbd1f3c963", LINKTOROW([_THISROW], Practitioners_Form))>>">Adjust this record</a>

I use it in an email body and it creates the link in the email just fine.

The issue I have is when I click the link, it attempts to open the page BUT it is missing the “:” after the “https” so the page cannot open. If I manually insert the “:” it then opens as expected.

I am nor sure what I need to do to retain the “:” in the final url. I tried adding the HTML encoded value for a colon. I tried wrapping the link in an ENCODEURL() function but these just make it worse.

How do I make the colon stay in the final URL?

and don’t know what to suggest other than:

  • : (which I think you’re saying you already tried)
  • try including the http:// as one or more concatenated elements
  • the advice I’ve seen from @SkrOYC --namely, don’t use the task’s email body property but rather use an HTML template file
1 Like

I’ll try this.

1 Like

So I’m not sure how to make an HTML template so I backed off that idea.

I started looking at the href link more closely and realized, at least in my use case, there was extra “stuff” not needed. I had an “http://” as well as an “https://”. Once I removed the “http://”, my email link worked great. I also realized I could just move the URL prefix outside of the pre-processed code (<<…>>) and I didn’t need the CONCATENATE() at all.

So after adjustments, I ended up with this reduced href version.

<a href="https://www.appsheet.com/start/a5910859-fda5-445d-8d3c-48bbd1f3c963
<<LINKTOROW([_THISROW],Practitioners_Form)>>">Adjust this record</a>

I hope this helps someone else!

2 Likes

Concatenate() is mainly not needed when you have just text strings thanks to how the <<>> stuff works. You can place those wherever you want inside your templates

1 Like