Skip to main content
Question

Formula URL Syntax Error (Case Function)

  • July 7, 2021
  • 0 replies
  • 36 views

Hello -

I'm unable to resolve a syntax error.  I copied a formula and tried to add a Case function, but am now getting a syntax error.

The original formula that works fine:

URLRoot() & "db/" & [_DBID_TP_MODEL_RESOURCE] & "?a=API_AddRecord&apptoken=dkmnkvc6xxfffbyjn4imbopoynw&_fid_55=32&_fid_38=" & [Record ID#] & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#])


The edited formula with the error:

URLRoot() & "db/" & [_DBID_TP_MODEL_RESOURCE] & "?a=API_AddRecord&apptoken=dkmnkvc6xxfffbyjn4imbopoynw&_fid_55=" &
Case([TP Model Def - Name],
"Clinical","32",
"Syn One","27",
"GCS","23",
"REMS","25",
"FSP","29",
"Systems Only","1",
"Early Phase (Clinical)","20")
&_fid_38=" & [Record ID#] & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#])

The syntax error highlights the first underscore in the first bit on the last line "&_fid_38..."

Thanks in advance for your help!

------------------------------
Melanie Mercadel
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
try this

URLRoot() & "db/" & [_DBID_TP_MODEL_RESOURCE] & "?a=API_AddRecord&apptoken=dkmnkvc6xxfffbyjn4imbopoynw&_fid_55=" &
Case([TP Model Def - Name],
"Clinical","32",
"Syn One","27",
"GCS","23",
"REMS","25",
"FSP","29",
"Systems Only","1",
"Early Phase (Clinical)","20")
& "&_fid_38=" & [Record ID#] & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#])

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------

I think I figured it out.  Why is it that you can try to resolve something for an hour, finally decide to ask for help, and then the solution comes to you right after you request help?

I added &" to the second to last line:
"Early Phase (Clinical)","20") &" 

QB then allowed me to save the field, and appears to be applying the Case function as intended.

I do have a follow up question though:  After I saved the field and reopend it, the last line of code appears as:

"Early Phase (Clinical)","20") &"\n&_fid_38=" & [Record ID#] & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#])

Any idea why the \n was automatically added here: &"\n&_fid_38?


​

------------------------------
Melanie Mercadel
------------------------------