--- title: "アクションの設定" url: https://docs.catalyst.zoho.com/ja/tutorials/ecommerce-bot/deluge/configure-actions/ description: "Catalyst ConvoKraft、Deluge関数、およびZoho CRMを使用して、ECサイト向けの会話型セールスアシスタントボットを構築します。Webサイトのユーザーと対話し、注文を管理します。" last_updated: 2026-08-17T12:16:04Z service: All Services type: tutorial related_links: - name: "アクションの作成" url: /ja/convokraft/help/actions/create-an-action/ - name: "ボットの作成" url: /ja/convokraft/help/bots/create-a-bot/ --- # アクションの設定 [ボットを作成](https://docs.catalyst.zoho.com/ja/convokraft/help/bots/create-a-bot/)した後、[アクションを作成](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/create-an-action/)し、必要に応じてアクションのレスポンスを設定する必要があります。一般的に、アクションのレスポンスは、ビジネスロジックに基づくもの、または操作を伴わない静的な直接レスポンスのいずれかに設定できます。このチュートリアルでは、すべてのアクションのレスポンスをビジネスロジックの実行に基づいて設定します。 Eコマースボットには以下のアクションを作成し、ユーザーがボットと直接対話して簡単に操作を実行できるようにします。 * **Eコマースストアの商品リストを表示する** * **新規注文を行う** * **注文の詳細を確認する** * **配送先住所を変更する** * **注文を後日に変更する** アプリケーションの特定のニーズに基づいてアクションを設定するには、適切なサンプル文とパラメータを定義する必要があります。このセクションでは、Eコマースボットの上記アクションに設定する[サンプル文](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/define-sample-sentences/)と[パラメータ](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/define-params/)について詳しく説明します。 [ConvoKraftボットを作成](https://docs.catalyst.zoho.com/ja/tutorials/ecommerce-bot/deluge/create-a-bot/)し、ビジネスロジックを構築するための適切な開発プラットフォームを選択すると、以下のスクリーンショットのようにボットの詳細ページが表示されます。 以下の手順に従って、Eコマースボットのアクションを作成・設定してください: 1. ボットを開いた後、**Create Action**をクリックして新しいアクションを追加します。 ![actions-page](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/actions-page.webp) 2. Eコマースボットの最初のアクションとして、ストアで利用可能な商品を一覧表示するアクションを作成します。 表示されるポップアップウィンドウで、アクション名に「List the items available in Store」と入力します。レスポンスを**Based on a business logic**に選択し、**Next**をクリックします。 ![list-items-action](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/list-items-action.webp) 3. 該当するサンプル文を設定します。会話形式では、ユーザーはさまざまな方法でこのアクションを呼び出す可能性があります。例えば、「list the items available」や「what are the products available in the store?」などです。このようなサンプル文を設定し、**Next**をクリックします。 ![list-items-sample-sentences](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/list-items-sample-sentences.webp) 4. このアクションにはパラメータを設定しません。このステップをスキップして**Save**をクリックしてください。 ![list-items-params](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/list-items-params.webp) 5. アクションのサンプル文とパラメータを設定すると、アクションの詳細ページが表示されます。 ![list-items-execution-function](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/list-items-execution-function.webp) ConvoKraftボットのビジネスロジックをDelugeで構築することを選択したため、Execution functionがデフォルトで有効になっています。 > **Note :** この特定のアクションでは、Execution functionのみを使用します。 **Edit Function**をクリックすると、ConvoKraft Delugeエディターが自動的に開きます。 6. ビジネスロジックをコーディングするには、以下のコードをエディターにコピー&ペーストし、**Save script**をクリックします。 ```javascript result = Map(); Accesstoken = invokeurl [ url :"https://test-773793963.development.catalystserverless.com/server/TokenGenerate/execute" type :GET ]; info Accesstoken.getJSON("output"); accesstoken = "Zoho-Oauthtoken " + Accesstoken.getJSON("output"); header_data = Map(); header_data.put("Content-Type","application/json"); header_data.put("Authorization",accesstoken); CRMresponse = invokeurl [ url :"https://www.zohoapis.com/crm/v2/EcomProducts?fields=Name,Product_image_url,Price,Inventory_Count,Product_image" type :GET headers:header_data ]; info CRMresponse; cardlist = List(); productNote = Map(); productNote.put("type","note"); productNote.put("content","List of items available are listed as follows "); cardlist.add(productNote); for each record in CRMresponse.getJSON("data") { info record; name = record.getJSON("Name"); price = record.getJSON("Price"); product_id = record.getJSON("id"); image = record.getJSON("Product_image_url"); inventory = record.getJSON("Inventory_Count"); listItem = Map(); listItem.put("type","list"); listItem.put("format","bullet"); listElements = List(); elem1 = {"label":"Name : " + name}; elem2 = {"label":"Total Price : $ " + price}; elem3 = {"label":"Product ID : " + product_id}; elem4 = {"label":"Stock : " + inventory}; listElements.add(elem1); listElements.add(elem2); listElements.add(elem3); listElements.add(elem4); listItem.put("elements",listElements); //info listItem; // 'image'カードの定義 // 'note'カードの定義 productPic = Map(); productPic.put("type","image"); productPic.put("content",record.getJSON("Product_image_url")); cardlist.add(productPic); cardlist.add(listItem); } info cardlist; result.put("card",cardlist); result.put("message","List of Objects in response"); return result; ``` > **Note :** Delugeエディターの詳細については、[このページ](https://www.zoho.com/deluge/help/deluge-editor.html)を参照してください。 ![list-edit-exec](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/list-edit-exec.webp) 7. ページの右下にある**Test this action**をクリックして、現在のアクションに行った設定をテストします。 ![list-test-action](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/list-test-action.webp) ここでのアクションのテストとは、ボットと対話し、特定のアクションの設定に関連する質問を行うことを意味します。 > **Note :** アクション用に設定したサンプル文がチャットウィンドウに候補として表示されます。リストから選択するか、お好みに応じてConvoKraftボットと独自の会話を開始できます。 例えば、チャットウィンドウに「Can you list the items with their stock」と入力します。ボットはメッセージの意図を理解し、定義されたサンプル文との一致を見つけて、ビジネスロジックを実行してレスポンスを返します。 ![test-list-action](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/test-list-action.webp) 8. アクションのテスト後、**DONE**をクリックして次に進みます。 同様に、Eコマースボットの残りのアクションを作成します。上記の手順はすべてのアクションに適用されますが、追加で[パラメータの作成](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/define-params/)や[コンテキストハンドラー関数](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/bot-logic/deluge-functions/context-handler-function/)でのロジック設定が必要になる場合があります。 ### 注文の発注 1. 前のステップで説明したように、ボットの詳細ページからビジネスロジックに基づいてレスポンスを返す新しいアクションを作成し、「Place an order」と名付けます。このアクションのサンプル文は以下のように定義できます: * "I want to place an order" * "I would like to place an order of the product id :5804508000000460006 to be delivered on 10-Jul-2023" 文を設定したら**Next**をクリックします。 ![place-order-params](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/place-order-params.webp) 2. **New Param**をクリックし、**String**を選択します。パラメータ名に「productid」と入力し、以下の表を参考にプロンプトメッセージを追加します。各パラメータタイプの属性の詳細については、[このページ](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/define-params/#attributes-of-a-param)を参照してください。 ![productid-param](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/productid-param.webp) このアクションには以下のパラメータを作成します:
パラメータタイプ 名前 プロンプトメッセージ バリデーション失敗時のプロンプトメッセージ
String `productid` Please enter the Product ID The entered ProductID is invalid. Please check and retry.
Email `cxemail` Please enter your Email ID The entered email ID is invalid. Please check and retry.
Date `cxdate` Please enter the date on which you expect the delivery The entered date is invalid. Please check and retry.
String `cxaddr` Please enter the address where you want the order to be delivered The entered address is invalid. Please check and retry.
同様に、上記の表に記載されたパラメータタイプとプロンプトメッセージで、残りの3つのパラメータ「cxemail」、「cxdate」、「cxaddr」を作成します。 > **Note :** 日付パラメータの入力モードは、お好みに応じて`Textual`または`Visual`を選択できます。 3. パラメータをサンプル文内の対応するテキストにマッピングし、ボットが会話中にユーザーから入力を順次取得するよう指示します。 サンプル文のテキストにカーソルを合わせ、対応するパラメータを選択して関連付けます。 ここでは、以下のスクリーンショットに示すように、「cxemail」、「productid」、「cxdate」をサンプル文内の対応する例の値に関連付けます。 ![place-order-association](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/place-order-association.webp) 4. アクションのサンプル文とパラメータを設定したら、**Save**をクリックします。 5. 次に、前のアクションと同様に、Execution functionでビジネスロジックをコーディングします。 以下のコードをExecution functionページにコピー&ペーストし、**Save Script**をクリックします。 ```javascript result = Map(); info productid; info cxemail; info cxdate; info cxaddr; placeorder = Map(); Accesstoken = invokeurl [ url :"https://test-773793963.development.catalystserverless.com/server/TokenGenerate/execute" type :GET ]; //URLのorg IDをご自身のプロジェクトのものに置き換えてください info Accesstoken.getJSON("output"); accesstoken = "Zoho-Oauthtoken " + Accesstoken.getJSON("output"); info accesstoken; header_data = Map(); header_data.put("Content-Type","application/json"); header_data.put("Authorization",accesstoken); try { //CRMresponse = invokeurl //[ // url :"https://www.zohoapis.com/crm/v2/EcomProducts/" + productid // タイプ: GET // connection:"ecommerce" //]; CRMresponse = invokeurl [ url :"https://www.zohoapis.com/crm/v2/EcomProducts/" + productid type :GET headers:header_data ]; info CRMresponse; if(CRMresponse.isNull() && CRMresponse.getJSON("status") != "error") { stock_count = 0; info "Empty response. So stock count reset"; placeorder.put("Stiock","Empty"); } else { recordid = CRMresponse.getJSON("data").getJSON("id"); stock_count = CRMresponse.getJSON("data").getJSON("Inventory_Count"); imageurl = CRMresponse.getJSON("data").getJSON("Product_image_url"); productname = CRMresponse.getJSON("data").getJSON("Name"); price = CRMresponse.getJSON("data").getJSON("Price"); } } catch (e) { info e.lineNo; // エラーが発生したステートメントの行番号を表示 info e.message; // エラーメッセージを表示 info e; // 行番号とエラーメッセージの両方を表示 } if(stock_count > 0) { stock_count = stock_count - 1; reduceStock = Map(); reduceStock.put("id",recordid); reduceStock.put("Inventory_Count",stock_count); updatedata = list(); updatedata.add(reduceStock); updatedatamap = Map(); updatedatamap.put("data",updatedata); //updateResp = invokeurl //[ // url :"https://www.zohoapis.com/crm/v2/EcomProducts" // タイプ:PUT // parameters:updatedatamap.toString() // connection:"ecommerce" //]; updateResp = invokeurl [ url :"https://www.zohoapis.com/crm/v2/EcomProducts" type :PUT parameters:updatedatamap.toString() headers:header_data ]; info updateResp; //info zoho.crm.updateRecord("EcomProducts",productid,reduceStock); placeorder.put("Name",productname + " " + cxdate); placeorder.put("Product_Name",productname); placeorder.put("Email",cxemail); placeorder.put("Delivery_Address",cxaddr); placeorder.put("Expected_Delivery_Date",cxdate.toDate("yyyy-mm-dd")); info toDate(cxdate,"yyyy-mm-dd"); info toDate(cxdate,"MM,d,yyyy"); placeorder.put("product_image_url",imageurl); placeorder.put("Price",price); placeorder.put("OrderID",productid + "_" + randomNumber(1111111,9999999)); placeorder.put("Order_Status","Reviewing the Order"); info placeorder; insertdata = list(); insertdata.add(placeorder); insertdatamap = Map(); insertdatamap.put("data",insertdata); //insertResp = invokeurl //[ // url :"https://www.zohoapis.com/crm/v2/Orders" // タイプ:POST // parameters:insertdatamap.toString() // connection:"ecommerce" //]; insertResp = invokeurl [ url :"https://www.zohoapis.com/crm/v2/Orders" type :POST parameters:insertdatamap.toString() headers:header_data ]; info insertResp; //info zoho.crm.createRecord("Orders",placeorder); result.put("message","Your order for the product - " + CRMresponse.getJSON("data").getJSON("Name") + " is placed successfully. It will be tried to be delivered on " + cxdate + " to " + cxaddr + " . Our Sales team will reach out to your via email to discuss about COD or prepayment before delivery."); } else if(stock_count == 0) { info "The item is out of stock. Please retry after some days as we restock."; result.put("message","The item is out of stock. Please retry after some days as we restock."); } else { result.put("message","There was some issue during the order. Please contact support team. They shall assist in placing this order for you."); } info stock_count; //zoho.crm.updateRecord("EcomProducts",productid, ) //result.put("message","Function executed successfully"); broadcast.put("cxemail",cxemail); result.put("broadcast",broadcast); return result; ``` > **Note :** 9行目のorg IDをご自身のプロジェクトのものに置き換えてから、スクリプトを保存してください。 6. 前のアクションと同様に、ConvoKraft Delugeエディターから[アクションをテスト](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/test-an-action/)し、**DONE**をクリックします。 ![test-place-order](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/test-place-order.webp) ### 注文詳細の確認 1. 新しいアクションを作成し、ビジネスロジックに基づくレスポンスを設定します。「View Order Details」と名付けます。 2. アクションに以下の[サンプル文](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/define-sample-sentences/)を追加します: * "Where is my order?" * "I want to view my order details of email id amelia.burrows@zylker.com" * "I want to check my order details" ![view-order-action](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/view-order-action.webp) 3. 前のセクションで説明したように、アクションに以下のパラメータを定義します。上記のスクリーンショットに示すようにパラメータをサンプル文に関連付け、**Save**をクリックします。
パラメータタイプ 名前 プロンプトメッセージ バリデーション失敗時のプロンプトメッセージ
Email `cxemail` Please provide the email ID associated with your order The entered email ID is invalid. Please check and retry.
4. アクションのサンプル文とパラメータを定義すると、アクションの詳細ページが表示されます。このアクションでは、[Execution function](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/bot-logic/deluge-functions/execution-function/)に加えて、[Context handler function](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/bot-logic/deluge-functions/context-handler-function/)も設定します。これは、Execution functionの[broadcast](https://docs.catalyst.zoho.com/ja/convokraft/help/actions/bot-logic/deluge-functions/execution-function/#broadcast)引数にユーザーのメールアドレスを保存し、チャットセッションの以降の会話でユーザーに毎回入力を求めるのではなく、メールアドレスを記憶するようConvoKraftボットに指示するために使用します。 以下のコードをExecution functionページにコピー&ペーストし、**Save Script**をクリックします。 ```javascript result = Map(); // 指定されたメールIDの特定の注文詳細を検索するためのAPI呼び出し //resp = zoho.crm.searchRecords("Orders","(Email:equals:" + cxemail + ")"); // JSONレスポンスから必要な詳細を抽出 //info resp; cardlist = List(); Accesstoken = invokeurl [ url :"https://test-773793963.development.catalystserverless.com/server/TokenGenerate/execute" type :GET ]; info Accesstoken.getJSON("output"); accesstoken = "Zoho-Oauthtoken " + Accesstoken.getJSON("output"); info accesstoken; header_data = Map(); header_data.put("Content-Type","application/json"); header_data.put("Authorization",accesstoken); //resp = invokeurl //[ // url :"https://www.zohoapis.com/crm/v3/Orders/search?criteria=" + "((Email:equals:" + cxemail + "))" // タイプ: GET // connection:"ecommerce" //]; resp = invokeurl [ url :"https://www.zohoapis.com/crm/v4/Orders/search?criteria=" + "((Email:equals:" + cxemail + "))" type :GET headers:header_data ]; info resp; items_count = 0; if(!resp.isEmpty()) { for each order in resp.getJSON("data") { items_count = items_count + 1; info "+++++++++++"; // order情報; orderid = order.getJSON("id"); //CRMresponse = invokeurl //[ // url :"https://www.zohoapis.com/crm/v3/Orders/" + orderid // タイプ: GET // connection:"ecommerce" //]; CRMresponse = invokeurl [ url :"https://www.zohoapis.com/crm/v3/Orders/" + orderid type :GET headers:header_data ]; name = order.getJSON("Name"); contact = order.getJSON("Contact_No").toString(); email = order.getJSON("Email"); product_name = order.getJSON("Product_Name"); orderid = order.getJSON("OrderID").toString(); price = order.getJSON("Price").toString(); delivery_date = order.getJSON("Expected_Delivery_Date"); delivery_address = order.getJSON("Delivery_Address"); order_status = order.getJSON("Order_Status"); // 箇条書きリストの定義 listItem = Map(); listItem.put("type","list"); listItem.put("format","bullet"); listElements = List(); elem1 = {"label":"Name : " + name}; elem2 = {"label":"Contact No :" + contact}; elem3 = {"label":"Email ID : " + email}; elem4 = {"label":"Product Name : " + product_name}; //elem5 = {"label":"Order ID : " + orderid}; elem6 = {"label":"Total Price : $ " + price}; elem7 = {"label":"Expected Delivery Date : " + delivery_date}; elem8 = {"label":"Delivery Address : " + delivery_address}; elem9 = {"label":"Order Status : " + order_status}; listElements.add(elem1); listElements.add(elem2); listElements.add(elem3); listElements.add(elem4); //listElements.add(elem5); listElements.add(elem6); listElements.add(elem7); listElements.add(elem8); listElements.add(elem9); listItem.put("elements",listElements); //info listItem; // 'image'カードの定義 // 'note'カードの定義 productNote = Map(); productNote.put("type","note"); productNote.put("content",items_count + ") Your order details for order id : " + orderid + " are listed as follows: "); cardlist.add(productNote); productPic = Map(); productPic.put("type","image"); productPic.put("content",CRMresponse.getJSON("data").getJSON("product_image_url")); cardlist.add(productPic); cardlist.add(listItem); info "+++++++++++"; } //info cardlist; result.put("card",cardlist); } else { } // broadcastの定義 broadcast.put("cxemail",email); result.put("broadcast",broadcast); result.put("message","The Shoppers Stores. You don't have an order."); return result; ``` > **Note :** 9行目のorg IDをご自身のプロジェクトのものに置き換えてから、スクリプトを保存してください。 5. アクションの詳細ページに戻り、以下のスクリーンショットに示すように**Context Handler Function**を有効にします。 ![view-order-context-handler](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/view-order-context-handler.webp) 6. Context handler functionを有効にした後、表示されるポップアップで**OK**をクリックして次に進みます。 ![context-pop-up](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/context-pop-up.webp) 7. 以下のコードをContext handler functionエディターにコピー&ペーストし、**Save Script**をクリックします。 ```javascript result = Map(); assign = Map(); if(broadcast != null) { // 'broadcast'引数にデータがあるかチェック cxemailid = broadcast.get("cxemailid"); // 'broadcast'から'cxemailid'の値を取得 assign.put("cxemailid",cxemailid); // cxemailidの値を'cxemailid'パラメータに割り当て result.put("assign",assign); result.put("todo","execute"); // Execution functionにジャンプ } result.put("todo","prompt"); return result; ``` 8. **Test this action**をクリックして、前のアクションと同様にこのアクションの更新された設定をテストします。 ![test-view](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/test-view.webp) 9. テスト後、**DONE**をクリックします。 ### 配送先住所の変更 1. 上記で作成したアクションと同様に、このアクションのレスポンスもビジネスロジックに基づいて設定します。アクション名に「Change Delivery Address」と入力します。このアクションには、以下のサンプル文を定義できます: * "I want my order to be delivered at a different address" * "I want to change delivery address for my order id 5804508000000460006 under the email amelia.burrows@zylker.com" アクションに以下のパラメータを追加します:
パラメータタイプ 名前 プロンプトメッセージ バリデーション失敗時のプロンプトメッセージ
Email `cxemail` Please provide the email ID associated with your order. The entered email ID is invalid. Please check and retry.
String `cxorderid` Please enter your Order ID. The entered OrderID is invalid. Please check and retry.
String `cxaddr` Please enter the address where you want the order to be delivered. The entered address is invalid. Please check and retry.
以下のスクリーンショットに示すように、パラメータ「cxemail」をサンプル文に関連付けることができます。 ![delivery-address-params](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/delivery-address-params.webp) 2. サンプル文とパラメータを設定したら、以下のコードをExecution functionページにコピー&ペーストし、**Save Script**をクリックします。 ```javascript result = Map(); // cache引数から注文の'id'を取得 Accesstoken = invokeurl [ url :"https://test-773793963.development.catalystserverless.com/server/TokenGenerate/execute" type :GET ]; info Accesstoken.getJSON("output"); accesstoken = "Zoho-Oauthtoken " + Accesstoken.getJSON("output"); info accesstoken; header_data = Map(); header_data.put("Content-Type","application/json"); header_data.put("Authorization",accesstoken); addrmap = Map(); //addrmap.put("Delivery_Address",cxaddr); //reduceStock = Map(); searchOrderresp = invokeurl [ url :"https://www.zohoapis.com/crm/v2/Orders/search?criteria=((OrderID:equals:" + cxorderid + "))" type :GET headers:header_data ]; recordid = searchOrderresp.getJSON("data").getJSON("id"); addrmap.put("id",recordid); addrmap.put("Delivery_Address",cxaddr); updatedata = list(); updatedata.add(addrmap); updatedatamap = Map(); updatedatamap.put("data",updatedata); updateResp = invokeurl [ url :"https://www.zohoapis.com/crm/v2/Orders" type :PUT parameters:updatedatamap.toString() headers:header_data ]; // 指定された日付に注文をリスケジュールするAPI呼び出し broadcast.put("cxemail",cxemail); // 'broadcast'引数の設定 result.put("broadcast",broadcast); result.put("message","Your order has been rescheduled successfully."); return result; ``` > **Note :** 5行目のorg IDをご自身のプロジェクトのものに置き換えてから、スクリプトを保存してください。 3. 再度、**Test this Action**チャットウィンドウを使用して、このアクションに関する会話を開始してテストします。 ![test-delivery-address](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/test-delivery-address.webp) ### 注文日のリスケジュール 1. アクション名に「Reschedule order to later date」と入力します。このアクションには、以下のサンプル文を定義できます: * "Reschedule my order to later date" * "Postpone the delivery date of my order" * "I want to change my orders delivery date as 19/07/2023 for my order id 5804508000000460006 of my email amelia.burrows@zylker.com" アクションに以下のパラメータを追加します:
パラメータタイプ 名前 プロンプトメッセージ バリデーション失敗時のプロンプトメッセージ
Email `cxemail` Please provide the email ID associated with your order. The entered email ID is invalid. Please check and retry.
String `cxorderid` Please enter your Order ID. The entered OrderID is invalid. Please check and retry.
Date `cxdate` Mention the date you would like to reschedule your order The entered date is invalid. Please check and retry.
以下のスクリーンショットに示すようにパラメータを関連付け、**Save**をクリックします。 ![reschedule-params](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/reschedule-params.webp) 2. サンプル文とパラメータを設定したら、以下のコードをExecution functionページにコピー&ペーストし、**Save Script**をクリックします。 ```javascript result = Map(); // cache引数から注文の'id'を取得 Accesstoken = invokeurl [ url :"https://test-773793963.development.catalystserverless.com/server/TokenGenerate/execute" type :GET ]; info Accesstoken.getJSON("output"); accesstoken = "Zoho-Oauthtoken " + Accesstoken.getJSON("output"); info accesstoken; header_data = Map(); header_data.put("Content-Type","application/json"); header_data.put("Authorization",accesstoken); searchOrderresp = invokeurl [ url :"https://www.zohoapis.com/crm/v2/Orders/search?criteria=((OrderID:equals:" + cxorderid + "))" type :GET headers:header_data ]; info searchOrderresp; recordid = searchOrderresp.getJSON("data").getJSON("id"); info recordid; datemap = Map(); datemap.put("id",recordid); datemap.put("Expected_Delivery_Date",cxdate.toDate()); info datemap; updatedata = list(); updatedata.add(datemap); updatedatamap = Map(); updatedatamap.put("data",updatedata); updateResp = invokeurl [ url :"https://www.zohoapis.com/crm/v2/Orders" type :PUT parameters:updatedatamap.toString() headers:header_data ]; info updateResp; // 指定された日付に注文をリスケジュールするAPI呼び出し broadcast.put("cxemail",cxemail); // 'broadcast'引数の設定 result.put("broadcast",broadcast); result.put("message","Your order has been rescheduled successfully."); return result; ``` > **Note :** 5行目のorg IDをご自身のプロジェクトのものに置き換えてから、スクリプトを保存してください。 3. 前のアクションと同様に、このアクションもテストして**DONE**をクリックします。 ![test-reschedule](https://catalyst-docs-development.zohostratus.in/images/tutorials/ecommerce-bot/deluge/test-reschedule.webp) これで、必要なすべてのアクションとそのビジネスロジックの設定が完了しました。