crmTech/ May 25, 2019/ Cloud, CRM, Salesforce Marketing Cloud/ 0 comments

Syntax: dataextension.Row.Lookup([“Field Name”],[“Hard coded value to search in field”,variable name to search the field]);

Find below code example to retrieve row from custom de.

%[ 
   var @FirstName
   SET @FirstName = QUERYPARAMETER("FirstName")
]%
<html>
  <title>Rows Lookup</title>
  <head></head>
  <body>
     <script runat=server type=text/javascript>
	Platform.Load("Core","1");
	var FirstName = Variable.GetFieldValue("@FirstName");
	try
	{
	  var de = DataExtension.Init('TEST_DE');//External Key of de
	  var rowCount = de.Rows.Lookup(["FirstName","LastName"], [FirstName,"XYZ"]);
	 if(rowCount.length >= 1)
	 {
	   FirstName = rowCount[0]["FirstName"];
	   LastName = rowCount[0]["LastName"];
	   FullName = FirstName + " " + LastName;//
	   Write("FullName" +FullName);
	}//if
      }//try
      catch(e)
      {
	 Write("<br>Exception: " + e);
      }//catch		
</script>
</body>
</html>

Advertisements
Share this Post

About crmTech

Sharad is working from more than 11 years in IT industry. He has giving his technical services in CRM for telecom, automobile, retail, finance industry in Sales, Service and Marketing. He has primary skill in Siebel and Salesforce Marketing Cloud. Apart from this he has worked in Google Cloud, Wordpress blogging, SEO optimization, Short film making, mobile apps creation,logo design creation for his own interest.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.