UiPath Documentation
activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

生产力活动

Insert an image into a Google Sheets cell

Summary: Display an image inside a Google Sheets cell using the Google Sheets IMAGE formula and the Write Cell activity.

Applications: Google Sheets

Description: This example explains how to use the Write Cell activity to write the Google Sheets IMAGE formula into a cell, which displays a publicly accessible image directly inside the cell.

备注:

The Google Sheets API does not support inserting images directly into cells. This tutorial shows a workaround using the IMAGE formula, which references a publicly accessible image URL and renders it inside the cell.

工作流

  1. 打开 Studio Web 并创建一个新项目。
  2. Add a Write Cell activity to your workflow.
  3. In the activity, configure the following:
    • 设置 Google 表格连接。
    • In the Spreadsheet field, browse and select the target spreadsheet.
    • In the Sheet/Named range field, select the sheet where you want to insert the image, for example, Sheet1.
    • In the Cell field, enter the target cell, for example, A1.
    • In the What to write field, enter the IMAGE formula with the publicly accessible URL of your image: =IMAGE("https://example.com/your-image.png").
  4. To control how the image fits the cell, add a mode parameter to the formula. The following modes are available:
    • =IMAGE("url", 1) — Resizes the image to fit inside the cell while maintaining the original aspect ratio. This is the default behavior.
    • =IMAGE("url", 2) — Stretches or compresses the image to fill the cell, ignoring the aspect ratio.
    • =IMAGE("url", 3) — Displays the image at its original size. The image may be cropped if it is larger than the cell.
    • =IMAGE("url", 4, height, width) — Displays the image at a custom size. Replace height and width with your desired pixel values, for example: =IMAGE("url", 4, 100, 200).
  5. 您已完成操作,可以运行项目了!

限制

Keep the following limitations in mind when you use this approach:

  • The image URL must be publicly accessible over HTTPS. Images behind authentication or access restrictions are not supported.
  • Google Drive images must be publicly shared (set to Anyone with the link can view) for the IMAGE formula to display them. Private Google Drive file links do not work.
  • The IMAGE formula adds a dynamic reference to the image URL, not a static embedded object. The displayed image updates if the content at the source URL changes.
  • 工作流
  • 限制

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新