PDF Template: check a multi select field for a specific value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ManfredWinter
    Junior Member
    • Dec 2025
    • 7

    #1

    PDF Template: check a multi select field for a specific value

    Hello everyone,

    I'm Manfred from Germany and I'm working on a PDF template for our customer to summarize their inquiry at us. In our deals there is a multi select field for the material of the customers products. For example "iron", "stainless steel", "copper" or "other".

    IF my sales colleague chooses just "other" or "iron" and "other", than there occurs a textfield ("materialtextfield") in the deal entity in which he describes the material of the customers products. For my example we can use "gold". So in the deal entity my sales colleague had chosen "iron", "other" and we writes in the occurred textfield "gold".

    My PDF template already prints the select materials of the multi select field. So in the printed document there is written: "materials: iron, other".
    Next to this I want to print what my sales colleague had written into the materialtextfield but only IF he had chosen "other".

    How can I search for "other" in all selected values of the multi select field "material"?

    just another explanation of my question:

    in the deal entitiy:
    - multi select field: material (values: iron, stainless steel, copper, other)

    IF "iron" is selected, the printed PDF looks like:
    - material: iron

    IF "iron" and "other" is selected (and the colleague described the other materials in the additional textfield of the deal entity as "gold"), the printed PDF should look like:
    - material: iron, other
    - other materials: gold

    how can I search for "other" in the multi select field "materials" and IF the search finds "other" (next to other values) than the text of the textfield (materialtextfield) should be printed?

    thank you very much, have a nice day.
    kind regars
    Manfred
  • heint
    Member
    • Jun 2025
    • 57

    #2
    Greetings, ManfredWinter,

    The following formula for PDF format is working well for me:

    Code:
    <p>Materials: {{cMaterials}}</p>
    
    
    {{#each cMaterials}}
    
    {{#ifEqual this 'other'}}
    
    <p>Other materials: {{../cStream}}</p>
    
    {{/ifEqual}}
    
    {{/each}}
    Important: Change values of cMaterials and cStream to your actual field names from Administration > Entity Manager > {your_Entity} > {target_Field} in the name field.

    Comment

    • ManfredWinter
      Junior Member
      • Dec 2025
      • 7

      #3
      Hello heint,

      thank you very much, that helped a lot and that works!

      Have a nice day.
      kind regards
      Manfred

      Comment

      Working...