formula field syntax error

Matt SonesMatt Sones 💎💎💎
edited September 12, 2019 in Questions
I'm getting this error in runtime:

Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('scheduledInitialAppointments','TotalRecords','grpCategories',{{grpCategories}}). SyntaxError: missing ) after argument list

However, as you can see from the formula reproduced in the error message, there is just one open and one close parenthesis.

Comments

  • Matt SonesMatt Sones 💎💎💎
    edited February 10, 2017
    This would be amusing, if I didn't need it to work. Even so, still slightly amusing.

    Errors:

    3. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('AVRonIntake','TotalRecords','grpCategories',{{{grpCategories}}})) *100. SyntaxError: missing ) after argument list
    4. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('AVRonIntake','TotalRecords','grpCategories',{{{grpCategories}}})) *100. SyntaxError: Unexpected token )
  • Matt SonesMatt Sones 💎💎💎
    edited February 10, 2017
    Single quotes, double quotes.
    double mustaches, triple mustaches.

    Still getting the same error on the model_lookup function:

    1. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('scheduledInitialAppointments','TotalRecords','grpCategories',{{grpCategories}}). SyntaxError: missing ) after argument list2. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('scheduledInitialAppointments','TotalRecords','grpCategories',{{grpCategories}}). SyntaxError: missing ) after argument list
    3. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('AVRonIntake','TotalRecords','grpCategories',{{{grpCategories}}}) *100. SyntaxError: missing ) after argument list
    4. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('AVRonIntake','TotalRecords','grpCategories',{{{grpCategories}}}) *100. SyntaxError: missing ) after argument list
    5. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('AVRonIntake','TotalRecords','grpCategories',{{{grpCategories}}}) *100. SyntaxError: missing ) after argument list
    6. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP('AVRonIntake','TotalRecords','grpCategories',{{{grpCategories}}}) *100. SyntaxError: missing ) after argument list
    7. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP("completedInitialAppointments","TotalRecords","grpCategories",Initial {{CaseType}} Appointment) *100. SyntaxError: missing ) after argument list
    8. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP("completedInitialAppointments","TotalRecords","grpCategories",Initial {{CaseType}} Appointment) *100. SyntaxError: missing ) after argument list
    9. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP("completedInitialAppointments","TotalRecords","grpCategories",Initial {{CaseType}} Appointment) *100. SyntaxError: missing ) after argument list
    10. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP("ReturnAppointmentsScheduled","TotalRecords","grpCategories",{{grpCategories}}) *100. SyntaxError: missing ) after argument list
    11. Invalid syntax for field formula: {{TotalRecords}} / MODEL_LOOKUP("ReturnAppointmentsScheduled","TotalRecords","grpCategories",{{grpCategories}}) *100. SyntaxError: missing ) after argument list
  • Matt SonesMatt Sones 💎💎💎
    edited February 10, 2017
    The Model lookup function only seems to work when I pass a static value for the last argument... it will not process merge syntax.

    Both of the following work:

    {{TotalRecords}} / MODEL_LOOKUP("completedInitialAppointments","TotalRecords","grpCategories","Initial Pregnancy Appointment") *100

    {{TotalRecords}} / MODEL_LOOKUP('numberOfSchedulingLeads','TotalRecords','grpCategories',null) *100
  • Rob HatchRob Hatch 💎💎💎
    edited September 1, 2016
    Is total records another formula field?  You alerted us to that issue last week. 
  • Matt SonesMatt Sones 💎💎💎
    edited February 10, 2017
    No, TotalRecords is a COUNT(Id).
  • Craig RosenbaumCraig Rosenbaum ✭✭✭✭
    edited September 12, 2019
    I'm getting this same error when trying to merge in a field from an external data source.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!