Power Automateを使用すると、Office Scriptsを自動化ワークフローに追加できます。これにより、メールの内容をワークシートに追加したり、Excelのコメントに基づいてプロジェクト管理ツールにアクションを作成したりできます。ただし、Power AutomateでOffice Scriptsを使用するには、Microsoft 365のビジネスライセンスが必要です。Excelでは、さまざまなフローテンプレートを使用して簡単にPower Automateを開始できます。また、データをフロー間で渡す設定が可能で、セキュリティに関する注意も必要です。詳細なチュートリアルやサンプルも利用できます。
Power Automate と Office Scripts の統合: スムーズな自動化の実現
Power Automateは、Office Scriptsを大規模な自動化フローに統合することを可能にする便利なツールです。これにより、電子メールの内容をスプレッドシートに追加したり、プロジェクト管理ツールに対してExcelのコメントに基づいたアクションを作成したりすることができます。
重要事項
Office Scriptsを使用するためには、Microsoft 365のビジネスライセンスが必要です。Office 365 Enterprise E1およびOffice 365 F3ライセンスは、ExcelでPower Automateと統合されていないため、Scriptsを利用することができません。
スタートガイド
Power Automateを始めたばかりの方は、Power Automateを始めることをお勧めします。このページでは、利用可能なすべての自動化の可能性について詳しく学ぶことができます。
ステップバイステップのチュートリアル
Power AutomateとOffice Scriptsの統合に関する3つのステップバイステップのチュートリアルがあります。これらのチュートリアルでは、各サービスをどのように組み合わせ、データをワークブックとフローの間で渡すかが示されています。
Excelからのフロー作成
Excelではさまざまなフローテンプレートを利用して、Power Automateを始めることができます。「自動化」タブを選択し、「タスクを自動化」をクリックします。このオプションを選択すると、Office Scriptsをより大きな自動化ソリューションに接続するためのいくつかのオプションが表示されます。
Excel コネクタ
Excel Online (Business) コネクタは、フローがExcelワークブックにアクセスするための手段を提供します。ここでは、Office Scriptsを呼び出すための2つのアクションがあります。
- スクリプトを実行: OneDriveのデフォルトの場所に保存されたスクリプトを使用します。
- SharePointライブラリからスクリプトを実行: チームのSharePointサイトに保存されたスクリプトを使用します。
データセキュリティ
「スクリプトを実行」アクションを使用すると、Excelコネクタを使用する人は、ワークブックやそのデータに大きなアクセス権を持つことになります。また、外部API呼び出しを行うスクリプトにもセキュリティリスクがあります。
管理者が機密性の高いデータの露出を懸念する場合は、Excel Onlineコネクタを無効にするか、Office Scripts管理者コントロールを通じてOffice Scriptsへのアクセスを制限することができます。
フローでのデータ転送
Power Automateを使用すると、フローアクション間でデータの転送が可能です。スクリプトは、必要な情報を受け取るように設定でき、ワークブックからフローに返したい情報を返すことができます。
例
以下のスクリーンショットは、フォームに新しい応答が送信されるとトリガーされるPower Automateフローを示しています。このフローは、フォームからの満足度の値をテーブルに追加するスクリプトを実行します。現在の平均満足度が返され、メールで送信されます。
function main(workbook: ExcelScript.Workbook, newData: string): number {
// 新しいデータをテーブルに追加
const table = workbook.getTable("SurveyTable");
table.addRow(-1, [newData]);
// 現在の満足度合計を取得
const satisfactionColumn = table.getColumnByName("Current Satisfaction");
const values = satisfactionColumn.getRangeBetweenHeaderAndTotal().getValues();
let total = 0.0;
values.forEach((value) => {
total += value[0] as number;
});
// 平均満足度を返す
return total / values.length;
}
最後に
Office ScriptsとPower Automateを使用することで、さまざまなタスクを自動化し、作業の効率を高めることができます。詳細については、Office Scriptsのサンプルとシナリオにアクセスしてください。これにより、Power Automateフローの中心にOffice Scriptsを活用する方法を理解することができます。
————-
Run Office Scripts with Power Automate – Office Scripts
Source link
The article discusses how to integrate Office Scripts into automated workflows using Power Automate, a feature available to users with a business license of Microsoft 365. Key functionalities include adding email content to Excel worksheets and triggering actions in project management tools based on comments in workbooks.
Key Points:
-
License Requirement: A business license of Microsoft 365 is necessary to use Office Scripts with Power Automate. While some licenses (like Office 365 Enterprise E1 and F3) allow for script use, they do not offer direct integration with Excel.
-
Script Scheduling: Users can automate script execution without relying on external applications via the Script scheduling feature.
-
Getting Started: New users are encouraged to visit the introductory resources for Power Automate, which provide insights into the automation capabilities and a focus on Office Scripts interaction for enhancing Excel functionality.
-
Tutorials: The article offers step-by-step tutorials demonstrating how to combine Power Automate with Office Scripts, including creating flows from Excel using a variety of templates found in the Automate tab.
-
Excel Connector: The Excel Online (Business) connector allows flows to access Excel workbooks, with two key actions to run scripts either from OneDrive or a SharePoint library.
-
Data Security: Using the "Run script" action can pose data security risks, especially if scripts make external API calls. Administrators can manage access to mitigate these risks, such as disabling Power Automate on unmanaged devices.
-
Data Transfer: Power Automate enables the transfer of data between flow actions, allowing scripts to accept inputs and return outputs, which can be passed as static values, expressions, or dynamic content.
- Example: The article illustrates a flow triggered by new form responses that updates a satisfaction table in Excel and returns the average satisfaction.
For further learning, examples and detailed guidelines on passing data to and from scripts can be found in the Office Scripts documentation.