製品ガイド
基本
自動化ガイド
統合ガイド
テンプレート
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自動化テンプレートをお勧めします

Product/market fit system
This template is designed for a product/market fit system, featuring resources for collecting and analyzing user feedback. Key components include a product feedback form and survey response database, allowing the team to gather and structure user insights on the product’s value and improvement areas. The survey responses are organized into views, including one restricted to founders and managers. Additionally, a database for key product features supports the linkage of benefits and feedback insights, facilitating a comprehensive overview for product development and market alignment
Product Messaging Library
The Product Messaging Library Template organizes your product is messaging guidelines, ensuring consistent communication across teams and helping maintain a unified brand voice.
Program Communications Plan
The Program Communications Plan template is a key strategic document outlining necessary communication strategies and responsibilities for project success. It defines key messages, audiences, channels, and timelines, ensuring all stakeholders are informed and engaged throughout the project lifecycle, crucial for transparency, expectation management, and fostering collaboration
Project Management
This template streamlines project management with centralized tasks, due dates, views, file sharing, comments, and assignee tracking, ensuring teams stay aligned and collaborate effectively in one space.
项目进度管理
通过集中管理项目和任务完成进度和执行情况,利用自动化功能跟进项目任务状态,有助于提高项目管理和任务协作的效率。
Project planning
Even the simplest project has many elements to track. With this comprehensive template, you can easily manage all project elements, ensuring you stay focused and in control throughout the project's lifecycle.