Skip to main content

在 Designer 工作流中使用 Alteryx One 宏

Insert Alteryx One macros, which are macros saved in your Alteryx One Library into Designer workflows. Designer references the selected macro in Alteryx One instead of relying on its local file path. This reference helps the workflow use the same macro across supported environments.

开始前

  • 请确保您已联网,并且 Designer 可以访问互联网。

  • Sign in to the Alteryx One workspace that contains the macro.

  • 确认您有权访问该宏。

Your active workspace determines which Alteryx One Library Designer uses.

Insert a Macro from Alteryx One

重要

To insert an Alteryx One macro into a workflow, Designer must be in Classic View. This option is not yet available in Modern View.

如果您的 Alteryx One 库中有 Designer 宏,可以从「画布」将其插入 Designer 工作流。

  1. 在 Designer 中,右键单击工作流画布的空白区域。

  2. 选择「插入」>「宏」>「Alteryx One 中的浏览」。Designer 中已打开的任一 Alteryx One 宏均由云图标标识。

  3. 在「宏浏览器」中,找到并选择一个宏。您可以使用可用的筛选选项缩小列表范围:

    • Select from All, Owned by Me, and Shared with Me.

    • Use the filter (funnel) icon to show macros based on these categories:

      • owner:显示由特定用户创建的宏。

      • Shared With: Show macros shared with specific users.

      • 标签:显示已应用特定 tags 的宏。

      • 创建者:显示由特定用户创建的宏。

  4. Use the dropdown in the Version column to select the version to use:

    • Select a numbered version to keep the workflow linked to that version.

    • (Default) Select Always Use Latest Version to always use the latest available version. At runtime, the workflow uses the latest version available in the Alteryx One library. The version is selected when workflow execution first reaches the macro and remains fixed for the rest of that workflow execution. This option does not limit selection to published versions.

  5. 选择「插入」。

Designer 会将该宏添加到画布,并将其 Alteryx One 资产引用和所选版本存储在工作流中。

A cloud icon indicates open macros in Designer that were opened from Alteryx One. You can also insert one of these open macros from Insert > Macro.

重要

Alteryx One macros are currently not available in the Designer tool palette. To use Alteryx One macros in Designer, add them to your workflow with the right-click Insert option.

更改宏版本

  1. Right-click the macro on the canvas.

  2. Select Choose Macro Version.

  3. Select a numbered version or Always Use Latest Version (if you always want to use the latest available version).

If you select Always Use Latest Version, the workflow can use a newer macro version when one becomes available. Review the workflow after the macro owner publishes an update.

打开引用的宏

双击画布上的云托管宏,即可在新版 Designer 选项卡中将其打开。您也可以右键单击该宏,然后选择「打开宏」。

Designer retrieves the selected macro version from Alteryx One. If Designer is offline, it can open the macro only when that version remains available in the local cache.

离线工作

When Designer is offline, only Insert > Macro > Browse Local is available and opens the local file browser. You can insert a local YXMC file, but you can’t browse the Alteryx One Library.

工作流中已存在的云托管宏可能仍可从 local 缓存中获取。如果 Designer 无法检索引用的宏,则会显示错误。

Save or Package the Workflow

Workspace Execution

要运行引用保存在您的 Alteryx One Library 中的宏的 Designer 工作流包(YXZP),您的 Workspace Execution 引擎版本必须为 2026.3 或更高版本。

将工作流作为 YXZP 文件保存到 Alteryx One 时,Designer 会保留 Alteryx One 宏引用。

When you save a workflow package as a YXZP file in Designer via File > Save As > Alteryx One:

  • Alteryx One macros are selected by default, and the package retains their Alteryx One references. Each macro is labeled Referenced Cloud Macro in Manage Dependencies with its location shown as Alteryx One Library\MyMacro, for example.

  • To package Alteryx One macro with your workflow, select Include as a copy from the macro's three-dot menu. This includes an independent copy* of the Alteryx One macro in the package (indicated by "Macro Copy" in the Dependencies list).

  • Make sure users and workspace execution environments can access any macro that remains referenced from Alteryx One.

  • To restore the reference to the macro in Alteryx One, select Referenced Cloud Macro from the three-dot menu.

宏副本

*如果您在「依赖项」中选择云托管宏,该宏的副本将保存到云中,并在工作流中被引用。因此,对原始宏的后续更新不会反映在您的工作流中。

当工作流包含引用的宏并将其保存到 Server 时,该宏始终会以副本形式包含在内。对原始云宏的后续更新不会反映在该工作流中。

Local macros: If your workflow also uses macros saved on your computer, an alert appears in Manage Dependencies. Select Upload All to upload them to your Alteryx One Library. From that point, the workflow references the Alteryx One macros instead of the local file paths. If an upload fails, select Retry. Go to Manage Dependencies for Workspace Execution.

您可以在工作流软件包(.yxzp)中将 Designer 宏作为依赖项包含,但无法将以 Designer 宏作为其主要资产的软件包保存。如果您尝试这样做,Designer 会显示错误消息。

Go to Workflow Management for information about saving workflows and managing package dependencies.