SOLVED

Re: Token makes form editor crash

Go to solution
Michael_Florin
Level 10

Token makes form editor crash

Hello friendly people,

 

I just wanted to create a form with a date selector and put a token here:

Michael_Florin_0-1669236154211.png

The token I have in my program is {{my.00_Webinar_Date}}. When I insert that, my editor crashes.

Michael_Florin_1-1669236212637.png

It's greyed out and nothing moves.

Michael_Florin_2-1669236242669.png

When I refresh my browser, my form looks like this:

 

Michael_Florin_3-1669236304083.png

As if the central frame didn't want to load anymore. There's nothing else I can except to delete that draft and start over.

 

Now here comes the _really_ wierd thing. It seems that this only occurs if my token starts with a numeral - like "0" in this case. I can save something like this:

Michael_Florin_4-1669236432134.png

That still makes my editor look very funky, but at least it's still functional:

 

Michael_Florin_5-1669236484305.png

Does anybody know what's going on here?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Token makes form editor crash

Not surprising because tokens are not JSON-escaped (and thus aren’t supported in this context, even if they sometimes appear to work). The form descriptor needs to be valid JSON. Very easy to break. In this case remember that JS variables and unquoted property names can’t start with a number — that’s probably the cause.

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Token makes form editor crash

Not surprising because tokens are not JSON-escaped (and thus aren’t supported in this context, even if they sometimes appear to work). The form descriptor needs to be valid JSON. Very easy to break. In this case remember that JS variables and unquoted property names can’t start with a number — that’s probably the cause.

Michael_Florin
Level 10

Re: Token makes form editor crash

Thank you Sanford! I've used program tokens all over forms all my life, and I thought this was best practice.

 

Anyway, I'll remove the numerals, but otherwise keep them. They are simply too useful here.