Lava Filters - AppendSegments

Category:Other

Description:Adds personalization segment information for the currently logged in user to the results of an entity command or Persisted Dataset.
Input:
Lava:

Entity Command Example

{%- contentchannel where:'Name == "Messages"' -%} {%- assign channelId = contentchannel.Id -%} {%- contentchannelitem where:'ContentChannelId == {{ contentchannel.Id }}' iterator:'Items' -%} {%- assign segments = Items | AppendSegments:'MARRIED' | Sort:'Title' -%}

{{ CurrentPerson.NickName }}, you might be interested in these messages on the topic of Marriage:

    {%- for item in segments -%} {%- if item.IsInSegment == true -%}
  • {{ item.Title }} [{{ item.MatchingSegments }}]
  • {% endif -%} {%- endfor -%}
{%- endcontentchannelitem -%} {%- endcontentchannel -%}

Persisted Dataset Example

{% assign matchedSegmentItems = 'MyContentChannelItemsDataset' | PersistedDataset | AppendSegments %}

Recommendations for {{ CurrentPerson.NickName }}:

    {%- for item in matchedSegmentItems -%}
  • {{ item.Title }} - {{ item.IsInSegment }}{% if item.MatchingSegments > '' %} [{{ item.MatchingSegments }}]{% endif %}
  • {% endfor -%}
Output:

Entity Command Example

Ted, you might be interested in these messages on the topic of Marriage:

  • Extended Family [Married]
  • How To Make Your Marriage Better Today [Married]
  • Immediate Family [Married]
  • The Secret That Could Cost You Your Marriage [Married]

Persisted Dataset Example

Recommendations for Ted:

  • Of Myths and Money - true [Attender, Has Given]
  • Of Faith and Firsts - true [Attender, Has Given]
  • Are You Dealing With Insecurity? - false
  • Hallelujah! - false
  • The Secret That Could Cost You Your Marriage - true [Married]
  • How To Make Your Marriage Better Today - true [Married]
  • Extended Family - true [Married, Small Group]
  • Immediate Family - true [Married]
  • Momentum At Home - true [Small Group]
  • Momentum At Work - false
  • Rich Fool - false
  • Two Debtors - false