Skip to main content

Macro

重要

The HTML GUI SDK uses outdated technology that limits your extension opportunities. We've built a new Platform SDK using Python and the latest open-source technology to deliver a vastly improved development experience. Go to Platform SDK to get started!

Use an Alteryx Designer Macro and the HTML GUI SDK to set up an existing macro as an engine component. Connect data items to interface tools, and match the names of the data stream connections to the Macro Input and Macro Output tools.

Prerequisites

To create a macro back end for a custom tool, we assume you are familiar with...

  • Alteryx Macros

  • File Management

See

or Alteryx Community for assistance with Alteryx Macros.

Set Up Files

  1. In the directory of your tool, add a folder named /Supporting_Macros. This gives your tool access to the macro, and prevents it from showing in the macro directories, in Designer.

  2. Place an existing macro in the /Supporting_Macros folder.

  3. In the Config.xml file, set the EngineSettings attribute EngineDllEntryPoint to the relative path to your macro. Set the attribute EngineDll to Macro.

<EngineSettings EngineDll="Macro" EngineDllEntryPoint="HtmlToolName\Supporting_Macros\MyMacro.yxmc" />

See Tool Configuration File.

Connect Data Items to Interface Tools

  1. In your tool's config.xml file, set the name attribute of the data item.

  2. In Designer, select the corresponding interface tool. In the Configuration window, access the Annotationtab, and change the tool name to match the name given to the data item. See Tool Configuration.

  3. Verify that the terms match.

    • Use the XML View tab for the interface tool within the macro.

    • Check the connection name in the XML configuration file. See Getting Started with Developer.

Tool Component

XML Example

DataItem referenced in the HTML GUI page

<Value name="username"></Value>

Corresponding interface tool XML

<Name>username</Name>

Match Data Stream Names

For each incoming or outgoing connection in your tool, your macro must have a corresponding Macro Input or Macro Output tool.

  1. In your tool's config.xml file, set the name attribute of the connection.

  2. In Designer, select the corresponding Macro Input or Macro Output tool. In the Configuration window, access the Configuration tab, and change the tool name to match the name given in the name property of the connection within your tool config.xml file. See Tool Configuration.

  3. Verify that the terms match.

    • Use the XML View tab for the Macro Input or Output tool within the macro.

    • Check the connection name in the XML configuration file. See Getting Started with Developer.