LINKTOFORM() appears to insert a carriage return that causes the link to fail

I use LINKTOFORM("Person","D_Tag",[_THISROW].[NFC])
It is marked as correct by the checker:

gefaila_0-1651573898166.png

The hyperlink generated was 
https://www.appsheet.com/start/6795d7f6-69ee-4f8b-97f3-b84d4af907be#control=%0APerson&defaults=%7B%2... 

This link doesn't work.
However, if I generate the link myself as
https://www.appsheet.com/start/6795d7f6-69ee-4f8b-97f3-b84d4af907be#control=Person&defaults=%7B%22D_... 

That does work.

Any idea why appsheet is inserting "%0A" (a carriage return) into the hyperlink?

0 6 233
6 REPLIES 6

Steve
Platinum 4
Platinum 4

At the very least, remove [_THISROW]. from the expression.

OK. 
However, that isn't a solution.

I found the cause.  This may trip other people up too.
It turns out that if you put carriage returns in the code (e.g. to neaten up functions, brackets, IF statements etc), then the code is passed as valid, but *some* carriage return gets inserted into the generated url.
In my case the carriage return had got misplaced, the code was correct but the url generation failed.
Probably users will expect that either
a) both the code check *and* the URL generation fail together
b) the code check and the URL generation both succeed.

 I doubt this will be a priority but worth leaving up in case anyone notices the same issue.

If you neaten a string (text) portion of your code using a Line Field (%0A is not CR), this LF is taken into account as part of the string, exactly like how a space would be handled. 

A string portion is any part of your code enclosed within single or double quotes, or returned by any of AppSheet text functions

I would be interested in seeing your neatened code please. Thank you.

I think I actually messed up the "neatening" completely.
What I had was

LINKTOFORM("

Person","D_Tag",[NFC]) 
which translated to https://www.appsheet.com/start/6795d7f6-69ee-4f8b-97f3-b84d4af907be#control=%0APerson&defaults=%7B%2... 

I see two newlines in your quoted text:

Steve_0-1651847430673.png

No surprise the resulting URL included a newline.

Top Labels in this Space