LookupRows

概要 

データエクステンションから、指定した値にフィールドが一致する行セットを取得します。追加のフィールド値ペアを AND 句の一部として指定できます。この関数は、最大 2000 行を返します。返される行の数または順序を詳細に制御するには、LookupOrderedRows() 関数を使用します。この制限はスクリプトのパフォーマンスの向上に役立ちます。

構文 

LookupRows(1, 2, 3)

関数のプロパティ 

序数説明
1string必須データエクステンションの名前
2string必須値の取得元の列の名前
3文字列または配列必須列値を照合するために使用する値

例 

1<script runat="server">
2     var dataRows = Platform.Function.LookupRows('CustomerData','Company','exampleCompany');
3     if(dataRows && dataRows.length > 0) {
4          for(var i=0; i<dataRows.length; i++) {
5               Platform.Response.Write(dataRows[i]["Email"]);
6          }
7     }
8</script>
1<script runat="server">
2     var dataRows = Platform.Function.LookupRows('CustomerData',['FirstName','LastName'],['Angela','Cruz']);
3     if(dataRows && dataRows.length > 0) {
4          for(var i=0; i<dataRows.length; i++) {
5               Platform.Response.Write(dataRows[i]["Email"]);
6          }
7     }
8</script>