Skip to main content
Became Hot Network Question
edited title
Link
zuzannamj
  • 14.5k
  • 3
  • 27
  • 56

Dynamic Content with AMPAMPscript: Reference data in a DE not used for sending

AMP and AMPscript are two different technologies
Source Link
zuzannamj
  • 14.5k
  • 3
  • 27
  • 56

I am super new to the forum and new to AMPAMPscript as well, so sorry if there's some imprecision in my question. :-)

I am trying to build some Dynamic Content for an email. I have 3 dynamic content blocks in total. The data for 2 of the blocks is contained in the same DE I will be using for the send out (A), and it works properly. I am having issues with the third block, which should use data located in another data extension (B - non-sendable). If I remove the third block (IF statement), then I do not get any error messages.

The logic is very simple and it's the same for all three blocks. If a = b, show content block x. If not, show content block y.

I know that B is NOT connected to the Main DE "Contacts" in Audience Builder. Also, "Hvilken_type_bolig" is not a boleean, while "Mode" and "Winner" are. Could that be the issue? Or is there a problem with my code?

Thank you and cheers :)

EDIT: The record I am trying to generate a Subscriber Preview with exists in all the above-mentioned DEs (Contacts, A, B) with the same SubscriberKey.

Error code:

An error occurred when attempting to parse HtmlEmailBody content for HTML content. MemberID: 100009251 JobID: 0 ListID: 0 Content Begins With: {{.block g432s5hg96 codesnippetblock}}{{.data}}{ "email": { "options": { "generateFro

Code:

%%[ Var @Winner, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey), 
Set @Winner = Lookup('A','Winner','SubscriberKey', @SubscriberKey)

%%[ Var @Create_Lead, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Create_Lead = Lookup('A','Create_Lead','SubscriberKey', @SubscriberKey)

%%[ Var @Hvilken_type_bolig, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Hvilken_type_bolig = Lookup('B','Hvilken_type_bolig','SubscriberKey', @SubscriberKey)

%%[IF (([Winner] == "True")) THEN]%% %%=ContentBlockById("1832577")=%% %%[ELSE]%% %%=ContentBlockById("1832580")=%%%%[ENDIF]%%
%%[IF (([Create_Lead] == "True")) THEN]%% %%=ContentBlockById("1836190")=%% %%[ELSE]%% %%=ContentBlockById("1836192")=%%%%[ENDIF]%%
%%[IF (([Hvilken_type_bolig] == "Andelsbolig")) THEN]%% %%=ContentBlockById("1836189")=%% %%[ELSE]%% %%=ContentBlockById("1836193")=%%%%[ENDIF]%%

I am super new to the forum and new to AMP as well, so sorry if there's some imprecision in my question. :-)

I am trying to build some Dynamic Content for an email. I have 3 dynamic content blocks in total. The data for 2 of the blocks is contained in the same DE I will be using for the send out (A), and it works properly. I am having issues with the third block, which should use data located in another data extension (B - non-sendable). If I remove the third block (IF statement), then I do not get any error messages.

The logic is very simple and it's the same for all three blocks. If a = b, show content block x. If not, show content block y.

I know that B is NOT connected to the Main DE "Contacts" in Audience Builder. Also, "Hvilken_type_bolig" is not a boleean, while "Mode" and "Winner" are. Could that be the issue? Or is there a problem with my code?

Thank you and cheers :)

EDIT: The record I am trying to generate a Subscriber Preview with exists in all the above-mentioned DEs (Contacts, A, B) with the same SubscriberKey.

Error code:

An error occurred when attempting to parse HtmlEmailBody content for HTML content. MemberID: 100009251 JobID: 0 ListID: 0 Content Begins With: {{.block g432s5hg96 codesnippetblock}}{{.data}}{ "email": { "options": { "generateFro

Code:

%%[ Var @Winner, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey), 
Set @Winner = Lookup('A','Winner','SubscriberKey', @SubscriberKey)

%%[ Var @Create_Lead, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Create_Lead = Lookup('A','Create_Lead','SubscriberKey', @SubscriberKey)

%%[ Var @Hvilken_type_bolig, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Hvilken_type_bolig = Lookup('B','Hvilken_type_bolig','SubscriberKey', @SubscriberKey)

%%[IF (([Winner] == "True")) THEN]%% %%=ContentBlockById("1832577")=%% %%[ELSE]%% %%=ContentBlockById("1832580")=%%%%[ENDIF]%%
%%[IF (([Create_Lead] == "True")) THEN]%% %%=ContentBlockById("1836190")=%% %%[ELSE]%% %%=ContentBlockById("1836192")=%%%%[ENDIF]%%
%%[IF (([Hvilken_type_bolig] == "Andelsbolig")) THEN]%% %%=ContentBlockById("1836189")=%% %%[ELSE]%% %%=ContentBlockById("1836193")=%%%%[ENDIF]%%

I am super new to the forum and new to AMPscript as well, so sorry if there's some imprecision in my question. :-)

I am trying to build some Dynamic Content for an email. I have 3 dynamic content blocks in total. The data for 2 of the blocks is contained in the same DE I will be using for the send out (A), and it works properly. I am having issues with the third block, which should use data located in another data extension (B - non-sendable). If I remove the third block (IF statement), then I do not get any error messages.

The logic is very simple and it's the same for all three blocks. If a = b, show content block x. If not, show content block y.

I know that B is NOT connected to the Main DE "Contacts" in Audience Builder. Also, "Hvilken_type_bolig" is not a boleean, while "Mode" and "Winner" are. Could that be the issue? Or is there a problem with my code?

Thank you and cheers :)

EDIT: The record I am trying to generate a Subscriber Preview with exists in all the above-mentioned DEs (Contacts, A, B) with the same SubscriberKey.

Error code:

An error occurred when attempting to parse HtmlEmailBody content for HTML content. MemberID: 100009251 JobID: 0 ListID: 0 Content Begins With: {{.block g432s5hg96 codesnippetblock}}{{.data}}{ "email": { "options": { "generateFro

Code:

%%[ Var @Winner, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey), 
Set @Winner = Lookup('A','Winner','SubscriberKey', @SubscriberKey)

%%[ Var @Create_Lead, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Create_Lead = Lookup('A','Create_Lead','SubscriberKey', @SubscriberKey)

%%[ Var @Hvilken_type_bolig, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Hvilken_type_bolig = Lookup('B','Hvilken_type_bolig','SubscriberKey', @SubscriberKey)

%%[IF (([Winner] == "True")) THEN]%% %%=ContentBlockById("1832577")=%% %%[ELSE]%% %%=ContentBlockById("1832580")=%%%%[ENDIF]%%
%%[IF (([Create_Lead] == "True")) THEN]%% %%=ContentBlockById("1836190")=%% %%[ELSE]%% %%=ContentBlockById("1836192")=%%%%[ENDIF]%%
%%[IF (([Hvilken_type_bolig] == "Andelsbolig")) THEN]%% %%=ContentBlockById("1836189")=%% %%[ELSE]%% %%=ContentBlockById("1836193")=%%%%[ENDIF]%%

added 156 characters in body
Source Link

I am super new to the forum and new to AMP as well, so sorry if there's some imprecision in my question. :-)

I am trying to build some Dynamic Content for an email. I have 3 dynamic content blocks in total. The data for 2 of the blocks is contained in the same DE I will be using for the send out (A), and it works properly. I am having issues with the third block, which should use data located in another data extension (B - non-sendable). If I remove the third block (IF statement), then I do not get any error messages.

The logic is very simple and it's the same for all three blocks. If a = b, show content block x. If not, show content block y.

I know that B is NOT connected to the Main DE "Contacts" in Audience Builder. Also, "Hvilken_type_bolig" is not a boleean, while "Mode" and "Winner" are. Could that be the issue? Or is there a problem with my code?

Thank you and cheers :)

EDIT: The record I am trying to generate a Subscriber Preview with exists in all the above-mentioned DEs (Contacts, A, B) with the same SubscriberKey.

Error code:

An error occurred when attempting to parse HtmlEmailBody content for HTML content. MemberID: 100009251 JobID: 0 ListID: 0 Content Begins With: {{.block g432s5hg96 codesnippetblock}}{{.data}}{ "email": { "options": { "generateFro

Code:

%%[ Var @Winner, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey), 
Set @Winner = Lookup('A','Winner','SubscriberKey', @SubscriberKey)

%%[ Var @Create_Lead, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Create_Lead = Lookup('A','Create_Lead','SubscriberKey', @SubscriberKey)

%%[ Var @Hvilken_type_bolig, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Hvilken_type_bolig = Lookup('B','Hvilken_type_bolig','SubscriberKey', @SubscriberKey)

%%[IF (([Winner] == "True")) THEN]%% %%=ContentBlockById("1832577")=%% %%[ELSE]%% %%=ContentBlockById("1832580")=%%%%[ENDIF]%%
%%[IF (([Create_Lead] == "True")) THEN]%% %%=ContentBlockById("1836190")=%% %%[ELSE]%% %%=ContentBlockById("1836192")=%%%%[ENDIF]%%
%%[IF (([Hvilken_type_bolig] == "Andelsbolig")) THEN]%% %%=ContentBlockById("1836189")=%% %%[ELSE]%% %%=ContentBlockById("1836193")=%%%%[ENDIF]%%

I am super new to the forum and new to AMP as well, so sorry if there's some imprecision in my question. :-)

I am trying to build some Dynamic Content for an email. I have 3 dynamic content blocks in total. The data for 2 of the blocks is contained in the same DE I will be using for the send out (A), and it works properly. I am having issues with the third block, which should use data located in another data extension (B - non-sendable). If I remove the third block (IF statement), then I do not get any error messages.

The logic is very simple and it's the same for all three blocks. If a = b, show content block x. If not, show content block y.

I know that B is NOT connected to the Main DE "Contacts" in Audience Builder. Also, "Hvilken_type_bolig" is not a boleean, while "Mode" and "Winner" are. Could that be the issue? Or is there a problem with my code?

Thank you and cheers :)

Error code:

An error occurred when attempting to parse HtmlEmailBody content for HTML content. MemberID: 100009251 JobID: 0 ListID: 0 Content Begins With: {{.block g432s5hg96 codesnippetblock}}{{.data}}{ "email": { "options": { "generateFro

Code:

%%[ Var @Winner, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey), 
Set @Winner = Lookup('A','Winner','SubscriberKey', @SubscriberKey)

%%[ Var @Create_Lead, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Create_Lead = Lookup('A','Create_Lead','SubscriberKey', @SubscriberKey)

%%[ Var @Hvilken_type_bolig, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Hvilken_type_bolig = Lookup('B','Hvilken_type_bolig','SubscriberKey', @SubscriberKey)

%%[IF (([Winner] == "True")) THEN]%% %%=ContentBlockById("1832577")=%% %%[ELSE]%% %%=ContentBlockById("1832580")=%%%%[ENDIF]%%
%%[IF (([Create_Lead] == "True")) THEN]%% %%=ContentBlockById("1836190")=%% %%[ELSE]%% %%=ContentBlockById("1836192")=%%%%[ENDIF]%%
%%[IF (([Hvilken_type_bolig] == "Andelsbolig")) THEN]%% %%=ContentBlockById("1836189")=%% %%[ELSE]%% %%=ContentBlockById("1836193")=%%%%[ENDIF]%%

I am super new to the forum and new to AMP as well, so sorry if there's some imprecision in my question. :-)

I am trying to build some Dynamic Content for an email. I have 3 dynamic content blocks in total. The data for 2 of the blocks is contained in the same DE I will be using for the send out (A), and it works properly. I am having issues with the third block, which should use data located in another data extension (B - non-sendable). If I remove the third block (IF statement), then I do not get any error messages.

The logic is very simple and it's the same for all three blocks. If a = b, show content block x. If not, show content block y.

I know that B is NOT connected to the Main DE "Contacts" in Audience Builder. Also, "Hvilken_type_bolig" is not a boleean, while "Mode" and "Winner" are. Could that be the issue? Or is there a problem with my code?

Thank you and cheers :)

EDIT: The record I am trying to generate a Subscriber Preview with exists in all the above-mentioned DEs (Contacts, A, B) with the same SubscriberKey.

Error code:

An error occurred when attempting to parse HtmlEmailBody content for HTML content. MemberID: 100009251 JobID: 0 ListID: 0 Content Begins With: {{.block g432s5hg96 codesnippetblock}}{{.data}}{ "email": { "options": { "generateFro

Code:

%%[ Var @Winner, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey), 
Set @Winner = Lookup('A','Winner','SubscriberKey', @SubscriberKey)

%%[ Var @Create_Lead, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Create_Lead = Lookup('A','Create_Lead','SubscriberKey', @SubscriberKey)

%%[ Var @Hvilken_type_bolig, @SubscriberKey 
Set @SubscriberKey = Lookup('Contacts','SubscriberKey','SubscriberKey', @SubscriberKey),
Set @Hvilken_type_bolig = Lookup('B','Hvilken_type_bolig','SubscriberKey', @SubscriberKey)

%%[IF (([Winner] == "True")) THEN]%% %%=ContentBlockById("1832577")=%% %%[ELSE]%% %%=ContentBlockById("1832580")=%%%%[ENDIF]%%
%%[IF (([Create_Lead] == "True")) THEN]%% %%=ContentBlockById("1836190")=%% %%[ELSE]%% %%=ContentBlockById("1836192")=%%%%[ENDIF]%%
%%[IF (([Hvilken_type_bolig] == "Andelsbolig")) THEN]%% %%=ContentBlockById("1836189")=%% %%[ELSE]%% %%=ContentBlockById("1836193")=%%%%[ENDIF]%%

Source Link
Loading