alQemist
alQemist

Reputation: 360

Cognito Forms filtering concatenated values from a repeating section

I have been successful in concatenating all emails from a repeatingSection in Cognito Forms but I want to filter which items are included based on another field in the repeatingSection.

NotificationList.Select(Email) - this work great. But I want to only include items where item.status = toplevelfield.status as an example.

Upvotes: -1

Views: 135

Answers (1)

alQemist
alQemist

Reputation: 360

I was able to accomplish this using a work around as follows:

  1. Add a calculation field RepeatingSection.ParentStatus = Status (toplevel field)
  2. Add a calculation field RepeatingSection.NotifyEmailCalc =ParentStatus.Contains(NotifyStatus) - this boolean is used to filter the Email list in next step
  3. at a toplevel calculation field - Emails=NotificationList.Where(NotifyEmailCalc = true).Select(Email)
  4. toplevel calculation fields "Email" = "Emails"
  5. InsertField 'Email' into the Update Workflow To:email in the template

Upvotes: 0

Related Questions