简体   繁体   English

我的AMPScript LookUp函数有什么问题?

[英]What is wrong with my AMPScript LookUp function?

Long time lurker, first time poster. 长期潜伏,第一次海报。 I really appreciate any help! 我非常感谢您的帮助!

I am trying to pull Subject Lines from a separate data extension than our sendable data extension. 我正在尝试从单独的数据扩展而非我们的可发送数据扩展中提取主题行。 There are different subject lines stored here, and they vary by each record. 这里存储了不同的主题行,并且每个记录各有不同。

I'm using the LookUp() function, but for some reason it only works if I choose the data extension that I am supposed to be looking up for a send preview in Exacttarget. 我正在使用LookUp()函数,但是由于某些原因,它仅在选择要在Exacttarget中查找发送预览的数据扩展名时才有效。

So let's say my sendable data extension is called "SendableDE" (creative, right?) and the data extension that I am looking up is "DEWithSubjectLines". 因此,假设我的可发送数据扩展名为“ SendableDE”(创意,对吗?),而我正在查找的数据扩展名为“ DEWithSubjectLines”。 For example, I have 例如,我有

%%[SET @subjectLine =     Lookup("DEWithSubjectLines","SUBJ_LINE","SUB_KEY",_subscriberkey)]%% Returns:     %%=v(@subjectLine)=%% 

So, if I choose "SendableDE" when I do a Send Preview in ET, the function returns nothing. 因此,如果在ET中执行“发送预览”时选择“ SendableDE”,则该函数将不返回任何内容。

But, if I choose "DEWithSubjectLines" when I do a send preview, the dynamic subject line is returned as intended and changes as I click through the different records. 但是,如果在发送预览时选择“ DEWithSubjectLines”,则动态主题行将按预期返回,并且在单击不同记录时会发生变化。 But why would it only work with that data extension? 但是为什么它只能与该数据扩展一起使用? That pretty much defeats the purpose of the LookUp function. 这几乎违反了LookUp函数的目的。

I must be missing something conceptually here. 我必须在概念上错过一些东西。 Any thoughts? 有什么想法吗? Thanks! 谢谢!

Welcome, Jake. 欢迎,杰克。 You'll get a lot more eyes on your SFMC questions over at salesforce.stackexchange.com , specifically with the Marketing-Cloud and AMPScript tags. salesforce.stackexchange.com上 ,您将对SFMC的问题有更多的关注,特别是使用Marketing-CloudAMPScript标签。

The _subscriberkey personalization string isn't assigned until an email is sent to an address for the first time. _subscriberkey将电子邮件发送到某个地址之前,不会分配_subscriberkey 个性化字符串 Perhaps you're previewing against an email address that has never been sent an email from the account? 也许您正在针对从未从帐户发送过电子邮件的电子邮件地址进行预览? Unless your business requirements dictate otherwise, it might be a good idea to use the emailaddr personalization string instead: 除非您的业务需求另有规定,否则最好使用emailaddr个性化字符串:

%%[

var @subjectLine
set @subjectLine = Lookup("DEWithSubjectLines","SUBJ_LINE","SUB_KEY",emailaddr)

]%%
<br>@subjectLine:%%=v(@subjectLine)=%%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM