Skip to main content
edit
Source Link
Duc Le
  • 3.8k
  • 2
  • 8
  • 28
  1. You can use BuildRowsetFromString function to achieve the result Something like this:
%%[
  set @categoryList = "News**Events"
  set @categoryRows = BuildRowSetFromString(@categoryList, "**")
  if RowCount(@categoryRows) > 0 then
    for @i= 1 to RowCount(@categoryRows) do
      set @row = Row(@categoryRows, @i)
      set @Category = Field(@row, 1)
      /* you put your processing here to pull the heading and text 
       E.g. LookupRows("NewsletterContent","Category", @Category)
      so on....
       */
    
    next @i
  ENDIF

]%%
  1. To pull the data based on location, then you need to lookup at location attribute. Put a validation on location value to check whether the location is null, otherwise it shows the default content. I would do something like this
%%[

set @Location= AttributeValue("Location")
set @rows = LookupRows("NewsletterContent","Location", @Location)
if RowCount(@rows) > 0 then
  /* pull the heading and text after that */

Put a validation on Text value to check whether the text is empty, otherwise it shows the default content

else
  set @Text@heading = field(@row,"Text")
if Empty(@text)'default THENheading'
  set @Text@text = 'default content' 
    
ENDIF

]%%

Note: the code above is not the full code, you need to adjust based on what you need.

  1. You can use BuildRowsetFromString function to achieve the result Something like this:
%%[
  set @categoryList = "News**Events"
  set @categoryRows = BuildRowSetFromString(@categoryList, "**")
  if RowCount(@categoryRows) > 0 then
    for @i= 1 to RowCount(@categoryRows) do
      set @row = Row(@categoryRows, @i)
      set @Category = Field(@row, 1)
      /* you put your processing here to pull the heading and text 
       E.g. LookupRows("NewsletterContent","Category", @Category)
      so on....
       */
    
    next @i
  ENDIF

]%%
  1. To pull the data based on location, then you need to lookup at location attribute. I would do something like this
set @Location= AttributeValue("Location")
set @rows = LookupRows("NewsletterContent","Location", @Location)
/* pull the heading and text after that */

Put a validation on Text value to check whether the text is empty, otherwise it shows the default content

set @Text = field(@row,"Text")
if Empty(@text) THEN
  set @Text = 'default content'    
ENDIF

Note: the code above is not the full code, you need to adjust based on what you need.

  1. You can use BuildRowsetFromString function to achieve the result Something like this:
%%[
  set @categoryList = "News**Events"
  set @categoryRows = BuildRowSetFromString(@categoryList, "**")
  if RowCount(@categoryRows) > 0 then
    for @i= 1 to RowCount(@categoryRows) do
      set @row = Row(@categoryRows, @i)
      set @Category = Field(@row, 1)
      /* you put your processing here to pull the heading and text 
       E.g. LookupRows("NewsletterContent","Category", @Category)
      so on....
       */
    
    next @i
  ENDIF

]%%
  1. To pull the data based on location, then you need to lookup at location attribute. Put a validation on location value to check whether the location is null, otherwise it shows the default content. I would do something like this
%%[

set @Location= AttributeValue("Location")
set @rows = LookupRows("NewsletterContent","Location", @Location)
if RowCount(@rows) > 0 then
  /* pull the heading and text after that */
else
  set @heading = 'default heading'
  set @text = 'default content' 
    
ENDIF

]%%

Note: the code above is not the full code, you need to adjust based on what you need.

Source Link
Duc Le
  • 3.8k
  • 2
  • 8
  • 28

  1. You can use BuildRowsetFromString function to achieve the result Something like this:
%%[
  set @categoryList = "News**Events"
  set @categoryRows = BuildRowSetFromString(@categoryList, "**")
  if RowCount(@categoryRows) > 0 then
    for @i= 1 to RowCount(@categoryRows) do
      set @row = Row(@categoryRows, @i)
      set @Category = Field(@row, 1)
      /* you put your processing here to pull the heading and text 
       E.g. LookupRows("NewsletterContent","Category", @Category)
      so on....
       */
    
    next @i
  ENDIF

]%%
  1. To pull the data based on location, then you need to lookup at location attribute. I would do something like this
set @Location= AttributeValue("Location")
set @rows = LookupRows("NewsletterContent","Location", @Location)
/* pull the heading and text after that */

Put a validation on Text value to check whether the text is empty, otherwise it shows the default content

set @Text = field(@row,"Text")
if Empty(@text) THEN
  set @Text = 'default content'    
ENDIF

Note: the code above is not the full code, you need to adjust based on what you need.