Too many open merges before close?

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
I have this long string of merges that I'm using in an 'update field on row' action:

{{Nurse_s_Notes__c}} {{#U_S_Performed__c}}U/S Performed. GA {{Gestational_Age_by_U_S_Weeks__c}}w{{Gestational_Age_by_U_S_Days__c}}d. {{#Fetal_number__c}}Pregnancy confirmed. FHR  {{Baby_1_FHR__c}}{{#Baby_2_FHR__c}}, {{Baby_2_FHR__c}}{{#Baby_3_FHR__c}}, {{Baby_3_FHR__c}}{{#Baby_4_FHR__c}}, {{Baby_4_FHR__c}}{{/Baby_4_FHR__c}}{{/Baby_3_FHR__c}}{{/Baby_2_FHR__c}}{{/Baby_1_FHR__c}}{{/Fetal_number__c}}{{^Fetal_number__c}}Unable to Confirm.{{/Fetal_number__c}} EDD {{Estimated_Due_Date_by_U_S__c}}{{/U_S_Performed__c}}

I get the following error:
Uncaught Error: Unclosed section "Fetal_number__c" at 798

The relevant fields are bold. Is there just too much between the first open and close?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
I think the error is actually that {{/Baby_1_FHR__c}} was never opened --- this may be throwing things off. Maybe change {{Baby_1_FHR__c}} to {{#Baby_1_FHR__c}}and see if that fixes it.
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
I think you were missing a starting tag for Baby 1, which I've added in bold. You are also crossing the merge syntax line from "helpful and intuitive" into "impossibly complicated".... :)

{{Nurse_s_Notes__c}} {{#U_S_Performed__c}}U/S Performed. GA {{Gestational_Age_by_U_S_Weeks__c}}w{{Gestational_Age_by_U_S_Days__c}}d.{{#Fetal_number__c}}Pregnancy confirmed. FHR  {{#Baby_1_FHR__c}}{{Baby_1_FHR__c}}{{#Baby_2_FHR__c}}, {{Baby_2_FHR__c}}{{#Baby_3_FHR__c}}, {{Baby_3_FHR__c}}{{#Baby_4_FHR__c}}, {{Baby_4_FHR__c}}{{/Baby_4_FHR__c}}{{/Baby_3_FHR__c}}{{/Baby_2_FHR__c}}{{/Baby_1_FHR__c}}{{/Fetal_number__c}}{{^Fetal_number__c}}Unable to Confirm.{{/Fetal_number__c}} EDD {{Estimated_Due_Date_by_U_S__c}}{{/U_S_Performed__c}}
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
I arrived at the same conclusion but went ahead a created a custom object to test the theory:


{{helios__Nurse_s_Notes__c}}
{{#helios__U_S_Performed__c}}
U/S Performed. GA {{helios__Gestational_Age_by_U_S_Weeks__c}}w{{helios__Gestational_Age_by_U_S_Days__c}}d. {{#helios__Fetal_number__c}}Pregnancy confirmed. FHR  {{#helios__Baby_1_FHR__c}}{{#helios__Baby_2_FHR__c}}, {{helios__Baby_2_FHR__c}}{{#helios__Baby_3_FHR__c}}, {{helios__Baby_3_FHR__c}}{{#helios__Baby_4_FHR__c}}, {{helios__Baby_4_FHR__c}}{{/helios__Baby_4_FHR__c}}{{/helios__Baby_3_FHR__c}}{{/helios__Baby_2_FHR__c}}{{/helios__Baby_1_FHR__c}}{{/helios__Fetal_number__c}}{{^helios__Fetal_number__c}}Unable to Confirm.{{/helios__Fetal_number__c}} EDD {{helios__Estimated_Due_Date_by_U_S__c}}
{{/helios__U_S_Performed__c}}


Yup, works.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Irvin gets this week's prize for "going beyond the call of duty!"   Thanks so much.  
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks, gentlemen! You all rock.

And yes... definitely stretching into the 'impossibly complicate' territory.