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]%%
Hvilken_type_bolig
is from a separate DE and not on the sendable data. If that is the case you need to changeIF (([Hvilken_type_bolig] == "Andelsbolig"))
toIF ((@Hvilken_type_bolig == "Andelsbolig"))
as you are using the variable you set above and not a field from the sendable data. If this field does not exist and you do not use AttributeValue() then it will throw an error. Usually a different error, but that might still be the problem. Also do not need the parenthesis around the if statements