Problem while passing parameters to a fragment inside a loop | Community
Skip to main content
Level 2
June 13, 2025
Question

Problem while passing parameters to a fragment inside a loop

  • June 13, 2025
  • 0 replies
  • 312 views

Hey There,

              Whenever I'm trying to pass values as parameters to an expression fragment inside the loop of an email visual fragment, the values are not getting passed. I want to call that expression fragment multiple times with different values passed each time. However, that is not the case when I try to pass values outside the loop. Temporarily, I'm using 'n' no of different variables to store that value inside the loop according to the counter like below.

{{#each array as |values|}} {% let counter = counter + 1 %} {%#if counter = 1 %} {% let val1 = values %} {%else if counter = 2 %} {% let val2 = values %} {%/if} {{/each}}
 
However, since this is not scalable and ideal, I want to know whether the ideal solution (passing inside a loop) is feasible in Adobe or not.

Let me give you an example of what I'm trying:
[In the expression fragment]

{{#inline "headline" name="Headline"}} {{/inline}} ------- {{{headline}}} -------

 

[In the email visual fragment]

{% let array = ["Headline 1", "Headline 2", "Headline 3"] %} {{#each array as |val|}} {{fragment id='ajo:90392d1e-264a-4acb-a12b-14c77742cb33' mode='inline' headline=val}} <!--Calling the expression fragment --> {{/each}}


When I try to simulate it, I see the fragment is getting called three times however, I'm not seeing the headline value being passed.
The output I get:

------- ------- ------- ------- ------- -------

vs The output I expect

------- Headline 1 ------- ------- Headline 2 ------- ------- Headline 3 -------

 

I'd appreciate it if anyone let me know whether that logic is feasible or not. If so, kindly do share the approach. Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.