Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

Personalization strings as AMPscript variables

$
0
0

This may seem like a seemingly simple thing to do, but I haven't had a need to tinker with AMPscript until recently. I'm merely looking up a value in a Data Extension based on a Subscriber ID. Here's what I'd like to achieve:

%%[ VAR @account_id SET @account_id = %%subscriberid%% ]%%<p>Your score is %%=Lookup("Sample Quiz","A1","account_id",@account_id)=%%</p>

Turns out that my personalization string in a variable is invalid AMPscript, which doesn't surprise me. If I hardcode a variable value it works fine:

%%[ VAR @account_id SET @account_id = 1 ]%%<p>Your score is %%=Lookup("Sample Quiz","A1","account_id",@account_id)=%%</p>

What's the correct syntax?


Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>