Add
Retrieve
Rows.Add
Rows.Lookup
Rows.Remove
Rows.Retrieve
Rows.Update
データエクステンションのデータ行を最大 2,500 行取得します。
Rows.Retrieve(1)
| 序数 | 型 | 説明 | |
|---|---|---|---|
| 1 | string | 取得でフィルターする情報を指定します。 |
このサンプルコードは、birthdayDE データエクステンションからすべての行を取得します。
1var birthdayDE = DataExtension.Init("birthdayDE");
2var data = birthdayDE.Rows.Retrieve();このサンプルコードは、簡単なフィルターを使用して、年齢が 20 より大きいすべての行を取得します。
1var birthdayDE = DataExtension.Init("birthdayDE");
2var filter = {Property:"Age",SimpleOperator:"greaterThan",Value:20};
3var data = birthdayDE.Rows.Retrieve(filter);このサンプルコードは、複雑なフィルターを使用して、年齢が 20 より大きく名が「Angel」のすべての行を取得します。
1var birthdayDE = DataExtension.Init("birthdayDE");
2var complexfilter = {
3 LeftOperand:{
4 Property:"Age",
5 SimpleOperator:"greaterThan",
6 Value:20
7 },
8 LogicalOperator:"AND",
9 RightOperand:{
10 Property:"FirstName",
11 SimpleOperator:"equals",
12 Value:"Angel"
13 }};
14var moredata = birthdayDE.Rows.Retrieve(complexfilter);この関数は、情報をオブジェクトの配列で JSON 形式で返します。
1[
2 {
3 "FirstName":"Angel",
4 "LastName":"Angel",
5 "EmailAddress":"aruiz@example.com",
6 "Age":"25",
7 "Birthday":"11/29/1985 12:00:00 AM"
8 }
9]Retrieve 関数は、メールメッセージまたはメールプレビューのコンテキストでは使用できません。