DOCX From Dynamic Template

Certified Senior Developer

HII,

I am getting an error when executing PM like :The entity name must immediately follow the '&' in the entity reference.

i am using docx from dynamic template pluginsDocTemplate.docx

I have attached my doc template  and code

if(
  a!isNullOrEmpty(ri!appId),
  {},
  a!localVariables(
    local!application: rule!GAI_getApplication(applicationId: ri!appId).data,
    local!fiscalYear1: local!application['recordType!{5f640b2a-afca-4569-92d3-9e2938c52816}GAI Application.relationships.{abdf1474-5557-4307-87ca-cebf6144aab0}gaiOpportunity.fields.{8140c1d1-fe02-45b1-b6bc-53f76502fad9}fiscalYear'] - 1,
    local!fiscalYear2: local!application['recordType!{5f640b2a-afca-4569-92d3-9e2938c52816}GAI Application.relationships.{abdf1474-5557-4307-87ca-cebf6144aab0}gaiOpportunity.fields.{8140c1d1-fe02-45b1-b6bc-53f76502fad9}fiscalYear'] - 2,
    local!fiscalYear3: local!application['recordType!{5f640b2a-afca-4569-92d3-9e2938c52816}GAI Application.relationships.{abdf1474-5557-4307-87ca-cebf6144aab0}gaiOpportunity.fields.{8140c1d1-fe02-45b1-b6bc-53f76502fad9}fiscalYear'] - 3,
    local!projectInfo: rule!GAI_getProjectInfoDisplaySummary(appId: ri!appId),
    local!problemIdentification1: rule!GAI_getAppProblemIdentification(appId: ri!appId).data,
    local!problemIdentification: concat(
      local!problemIdentification1['recordType!{1f8e454e-ed64-48e6-8bb1-802d148bb531}GAI Application Essay Problem.fields.{c90d55fc-848d-43bc-8db9-6dca0a52233a}problemIdentification'],
      local!problemIdentification1['recordType!{1f8e454e-ed64-48e6-8bb1-802d148bb531}GAI Application Essay Problem.fields.{2b903498-e32a-4b31-85e3-c2a985fe343e}problemIdentification2'],
      local!problemIdentification1['recordType!{1f8e454e-ed64-48e6-8bb1-802d148bb531}GAI Application Essay Problem.fields.{f0ffff16-529c-444c-9baa-7a8566690f5d}problemIdentification3']
    ),
    local!programAssessment1: rule!GAI_getAppProgramAssessment(appId: ri!appId).data,
    local!programAssessment: concat(
      local!programAssessment1['recordType!{eaf9b94a-77b9-4612-9c7d-a7fe76cceb27}GAI Application Essay Program Assm.fields.{2a9ae9de-be1d-4772-9e8a-397b94e78df9}programAssessment'],
      local!programAssessment1['recordType!{eaf9b94a-77b9-4612-9c7d-a7fe76cceb27}GAI Application Essay Program Assm.fields.{9f308bfa-8ef7-457b-9061-aed4d18b33b8}programAssessment2'],
      local!programAssessment1['recordType!{eaf9b94a-77b9-4612-9c7d-a7fe76cceb27}GAI Application Essay Program Assm.fields.{210ac181-e098-4942-8e3b-a738f29879c2}programAssessment3']
    ),
    local!grantDocument: rule!GAI_getGrantDocument(applicationId: ri!appId, isactive: true()).data,
    local!progAsssmntChart: index(
      rule!GAI_getPrgmActvtyAssessmentByApplnId(applicationId: ri!appID),
      "data",
      null
    ),
    local!programAssessmentChart: rule!GAI_convertPgmActvtyAssmntDataToTempData(
      pgmActvtyAssmnt: local!progAsssmntChart,
      applicationId: ri!appID
    ),
    local!activityName: rule!GAI_getRefProgramActivity(
      programActivityId: tointeger(
        local!programAssessmentChart.fk_program_activity_id
      )
    ).data['recordType!{c1b3acd6-4f4f-401f-828d-b60dc3af6722}GAI Ref Program Activity.fields.{c6132d99-98ea-42d1-a06a-2c005c045e8e}activityName'],
    local!now: text(now(), "DD/MM/YYYY HH:MM:SS"),
    local!judrication: if(
      index(
        local!projectInfo,
        "isJurisdictionFedFunds",
        {}
      ),
      "Yes",
      "No"
    ),
    local!fundOtherSource: if(
      index(
        local!projectInfo,
        "isFundSoughtOtherSources",
        {}
      ),
      "Yes",
      "No"
    ),
    local!nonProfit: if(
      index(local!projectInfo, "isNonProfit", {}),
      "Yes",
      "No"
    ),
    concat(
      "<dynamic>",
      "<title>",
      local!application['recordType!{5f640b2a-afca-4569-92d3-9e2938c52816}GAI Application.relationships.{abdf1474-5557-4307-87ca-cebf6144aab0}gaiOpportunity.fields.{47017e97-a5d2-4248-a00d-13cc0627e773}opportunityTitle'],
      "</title>",
      "<fiscalYear1>",
      local!fiscalYear1,
      "</fiscalYear1>",
      "<fiscalYear2>",
      local!fiscalYear2,
      "</fiscalYear2>",
      "<fiscalYear3>",
      local!fiscalYear3,
      "</fiscalYear3>",
      "<dateTime>",
      local!now,
      "</dateTime>",
      "<projectTitle>",
      index(local!projectInfo, "projectTitle", {}),
      "</projectTitle>",
      "<projectSummary>",
      index(local!projectInfo, "projectSummary", {}),
      "</projectSummary>",
      "<startDate>",
      index(
        local!projectInfo,
        "auditPeriodFromDate",
        {}
      ),
      "</startDate>",
      "<endDate>",
      index(
        local!projectInfo,
        "auditPeriodToDate",
        {}
      ),
      "</endDate>",
      "<judrication>",
      local!judrication,
      "</judrication>",
      "<fundOtherSource>",
      local!fundOtherSource,
      "</fundOtherSource>",
      "<nonProfit>",
      local!nonProfit,
      "</nonProfit>",
      "<problemIdentification>",
      local!problemIdentification,
      "</problemIdentification>",
      "<programAssessment>",
      local!programAssessment,
      "</programAssessment>",
      "<documents>",
      a!forEach(
        items: local!grantDocument['recordType!{4f36bc57-dc6a-4815-9b5c-f8df2a66f30a}GAI Grant Document.fields.{02c719ff-0b99-4735-885f-f7fb13d5959d}appianDocId'],
        expression: concat("<documents='", fv!item, "' />")
      ),
      "</documents>",
      "<documentsTitle>",
      a!forEach(
        items: local!grantDocument['recordType!{4f36bc57-dc6a-4815-9b5c-f8df2a66f30a}GAI Grant Document.relationships.{2a72a602-38d8-45a3-9e4b-4f6d23472477}gaiRefDocType.fields.{87f2b9f6-fadf-469c-b7eb-0abba3d94491}docType'],
        expression: concat("<documentsTitle='", fv!item, "' />")
      ),
      "</documentsTitle>",
      "<activityName>",
      a!forEach(
        items: local!activityName,
        expression: concat("<activityName='", fv!item, "' />")
      ),
      "</activityName>",
      "<year1_value>",
      a!forEach(
        items: index(
          local!programAssessmentChart,
          "year1_value",
          {}
        ),
        expression: concat("<year1_value='", fv!item, "' />")
      ),
      "</year1_value>",
      "<year2_value>",
      a!forEach(
        items: index(
          local!programAssessmentChart,
          "year2_value",
          {}
        ),
        expression: concat("<year2_value='", fv!item, "' />")
      ),
      "</year2_value>",
      "<year3_value>",
      a!forEach(
        items: index(
          local!programAssessmentChart,
          "year3_value",
          {}
        ),
        expression: concat("<year3_value='", fv!item, "' />")
      ),
      "</year3_value>",
      "</dynamic>"
    )
  )
)
here

how can i resolve this

  Discussion posts and replies are publicly visible