It seems you may be using English. Would you like to go to the international site? bika.ai
製品ガイド
基本
自動化ガイド
統合ガイド
テンプレート
Open API
機能リファレンス
自動化トリガー
自動化アクション
サードパーティ統合
ノードリソース
データベースビュー
データベースフィールド
ダッシュボードウィジェット
ミッション
AI ウィザード
フォーミュラ
空間
リリースノート
Videos

スクリプト実行アクションガイド

この自動化機能では、指定されたプログラミング言語でコードスニペットを実行できます。現在、次の3つのプログラミング言語をサポートしています:JavaScript、TypeScript、Python。

設定手順の詳細

この機能を使用するには、JavaScript、TypeScript、またはPythonで書かれたスクリプトファイルを準備する必要があります。

1. スクリプトの作成

ユーザーはBIKAスクリプトエディタで直接スクリプトを作成できます。スクリプトで使用するプログラミング言語を明確に指定する必要があります:JavaScript、TypeScript、またはPython。

2. 「スクリプトを実行」アクションの設定

BIKAの自動化インターフェースで「スクリプトを実行」アクションを設定するには、以下の手順に従ってください:

サポートされる言語とライブラリ

  • JavaScriptおよびTypeScript

    • fetchaxioslodashなどのライブラリをサポートしています。

    • JSONデータを自動化ワークフローに返すことができます。

      • サンプルコード:

        const str = 'Hello, World!';
        const json = { str };
        json;
        

        JavaScriptサンプル1

    • 非同期関数の場合、async functionで囲み、returnキーワードを使用してデータを返すことをお勧めします。

      • サンプルコード:

        (async () => {
          const url = 'https://api.exchangerate-api.com/v4/latest/USD';
          const response = await fetch(url);
          if (!response.ok) {
            throw new Error(response.status);
          }
          return await response.json();
        })();
        

        JavaScriptサンプル2

  • Python

    • サポートされているライブラリにはnumpyhttpxbs4pandasが含まれます。

    • requestsライブラリはサポートされていません。

    • すべての戻り値変数は自動化ワークフローに出力されます。

      • サンプルコード:

        import httpx
        url = 'https://api.exchangerate-api.com/v4/latest/USD'
        r = httpx.get(url)
        data = r.json()
        

        Pythonサンプル

3. 自動化アクションの設定

  1. 自動化タスク編集ページで新しいアクションを追加し、アクションタイプリストから「スクリプトを実行」を選択します。

  2. スクリプト言語を選択します:JavaScript、TypeScript、またはPython。

  3. 「スクリプト内容」エリアにスクリプトコードを入力します。例えば、Pythonスクリプトで「Hello World」を表示する簡単なスクリプトを実行できます:

    print("Hello World")
    
  4. 保存して有効化:スクリプト設定が完了したら、「保存」をクリックしてアクションを保存します。

4. テスト実行

  1. テスト実行:
  • 自動化タスクインターフェースに戻ります。
  • ページの下部にある「今すぐ実行」ボタンをクリックすると、設定に基づいてシステムがスクリプトを実行します。
  1. 結果の確認:スクリプト実行後、実行履歴を確認して出力結果を確認できます。スクリプトが順調に実行され、期待される結果が返された場合、設定が正しいことになります。

これで、「スクリプトを実行」の自動化アクションの設定と実行が成功裏に完了しました。

bika cta

おすすめの読み物

AI自動化テンプレートをお勧めします

OKR(目标与关键成果)管理与报告自动化
OKR(Objectives and Key Results)即目标与关键成果法,是一套明确和跟踪目标及其完成情况的管理工具和方法。1999年OKR在谷歌发扬光大,在Facebook、LinkedIn等企业广泛使用。
OKR Tracking
Companies recognize the importance of OKR tracking for alignment and productivity, but differ on the best approach. For a smooth and efficient way to manage OKRs, consider our tracking template—it's all you need to advance your company's vision.
PR & media CRM
This template helps manage media and public relations, track important articles, publications, and media contacts, and facilitate effective communication and collaboration.
商品カタログ
一个包含产品和供应商表的产品目录模板。以售卖表带为例,记录表带的分类,材质,采购价格,供应商信息。
Product Feedback Analysis
This template is designed to help teams efficiently collect and analyze customer feedback. Users can upload reviews, feedback, or other relevant data to identify common issues. The customizable dashboard allows for easy viewing and analysis of data, ultimately enhancing the overall customer experience.
Product Feedback Form
The Product Feedback template is structured to collect and manage feedback efficiently. This template includes resources like a feedback form and a database, which together streamline the process of gathering, categorizing, and storing feedback data for product improvement.