You are viewing limited content. For full access, please sign in.

Question

Question

How reference each set of collection fields

asked on March 2, 2023

Is there an updated way to loop through the collection and display the results in an email being sent by Forms?

I'd like to show some fields in a collection in an email. And I'd like to list them in groups by collection.

Currently, if I reference the field in a collection, all values are dumped out in at once.

 

Something like:

{/dataset/Collection_1/field1[1]}

{/dataset/Collection_1/field2[1]}

{/dataset/Collection_1/field3[1]}

 

{/dataset/Collection_1/field1[2]}

{/dataset/Collection_1/field2[2]}

{/dataset/Collection_1/field3[2]}

 

I'm not sure how to loop through the index of the collection. This seems like it should be built in to Forms, but I may have to create a workflow just to send an email.

0 0

Replies

replied on March 2, 2023

Hi Kenny,

The token {/dataset/Collection_1/field1[1]} should work, have you tried it in your email?

0 0
replied on March 3, 2023 Show version history

@████████

I have not. This prompts me with 2 questions:

  1. Where do I find the documentation for this syntax? I've spent a long time looking.
  2. Is there a method that automatically iterates through as many sets as exist, so I don't have to manually make a bunch of tokens in the email that may go unused? 
    Similar to the "INDEX(Collection.V_1,ROW())" syntax used in fields.
0 0
replied on March 6, 2023

I didn't find it in document either; the syntax is in xpath so it could use the index attribute.

As for "automatically iterates through as many sets as exist", INDEX(Collection.V_1,ROW()) is defined inside a row so ROW() means current row; there is no way to make a for loop inside email.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.