Articles in this section

Reference an alias in hook scripts

Reference an alias in a hook script to point to a connection, export, import, flow, or lookup cache without hardcoding its ID. This procedure is for developers who write hook scripts, such as preSavePage and postMap.

Prerequisites:

Copy an alias into a hook script

  1. Go to Build Build icon, and then select Flows.
  2. Open the flow.
  3. On the step that uses the hook, select ..., and then select the hook. On an export, select Pre save page hook. On an import, select Pre map hook, Post map hook, or Post submit hook.
  4. In the Hooks drawer, next to Scripts, select Edit script. It's unavailable until you select a script. To write a new script, select Create script.
  5. At the top right of the Script editor, select View aliases. On a narrow window, View aliases is in the ... menu.
  6. Find the alias for the resource.
  7. (Optional) In the Actions column, select View details to see more about the alias.
  8. In the Actions column, select Copy alias.
  9. Paste the alias where your script references the resource.
  10. If Auto preview is on, or you select Preview, the alias resolves and the output of the function appears.