I am running into this issue ever since i started working on the formula field with hyperlink function: My formula is :

HYPERLINK("https://mycompany.getfeedback.com/r/" & Token_ID__c & "?ContactID=" & Contact_CASESAFEID__c & "&AccountID=" & Account_CASESAFEID__c & "&SurveyID=" & Survey_CASESAFEID__c & "&gf_unique=" & Survey_CASESAFEID__c, "Launch Survey", "_blank")

I am stuck in using ?gf_unique or &gf_unique. this is the end point to the URL which differenciates if a user has launched the survey or not.

I've encountered the following errors:

syntax error missing ')'


Compiled formula is too big to execute (5,726 characters). Maximum size is 5,000 characters.

  • What you have pasted above has a syntax error"&gf_unique=Survey_CASESAFEID__c should be "&gf_unique="&Survey_CASESAFEID__c
    – gNerb
    Jun 7, 2018 at 14:56
  • Hello gNerb, When I modify the formula, I get the error Error: Syntax error. Found 'Survey_CASESAFEID__c'.
    – abhi
    Jun 7, 2018 at 15:00
  • You're missing another quotation mark and &s at the end of the formula. Like @gNerb showed, you have to quote all text strings and not quote fields you're included, and you need to join each with &.
    – David Reed
    Jun 7, 2018 at 15:05
  • I think you're also missing a comma right before the "Launch survey " parameter.
    – gNerb
    Jun 7, 2018 at 15:14
  • I updated your question is what should be the correct syntax, Apologies if I missed something.
    – gNerb
    Jun 7, 2018 at 15:17

1 Answer 1


As discussed in the comments, your syntax had a few issues. Namely, you were missing a few key """ characters and "&" characters as well as a comma separating your parameters.

HYPERLINK("https://mycompany.getfeedback.com/r/" & Token_ID__c & "?ContactID=" & Contact_CASESAFEID__c & "&AccountID=" & Account_CASESAFEID__c & "&SurveyID=" & Survey_CASESAFEID__c "&gf_unique=Survey_CASESAFEID__c "Launch Survey", "_blank")

Was changed to

HYPERLINK("https://mycompany.getfeedback.com/r/" & Token_ID__c & "?ContactID=" & Contact_CASESAFEID__c & "&AccountID=" & Account_CASESAFEID__c & "&SurveyID=" & Survey_CASESAFEID__c & "&gf_unique=" & Survey_CASESAFEID__c , "Launch Survey", "_blank")

(I bolded the changes but the comma is kind of hard to see. It is just before the launch survey parameter)

As far as your compile size issue. There's not much you can do for that given what you need in your URL. My guess is that most of your Custom ID fields are formulas and the formula adds all of their compile sizes into it's own and the combined size of all of the fields with the hyperlink function is too large.

Here are some Ideas I have for working around this limit:

  • If you have access to the target webpage where the survey should take place, you can update it to query for the parameters from salesforce at run-time which would allow you to significantly trim down your formula.
  • Use an intermediary page - this is similar to the first solution but instead of routing users to a page on a different website, route them to a VF page that can query for the information and then build out the URL via apex where there is no compile size limit, then redirect the user from your VF page to the survey.
  • Try using a custom link instead of a formula. Would look very similar to what you have. The only limitation is on where it can be placed on the page layout. I'm sure that custom links have their own limits but you'd be removing the need for the HYPERLINK function which should reduce the compile size. Hopefully enough to get rid of that error for you.
  • Same as above but with a custom button.
  • If you're using lightning you can develop a custom component to direct users to the survey.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .