Modify the Input Parameters and Return Type of a User-Defined Function

After setting a user-defined function's input parameters and return type in the Settings window, they can be modified at any time, even if the function or its assets are in use in the project.

Locate Where a Function's Input Parameters and Return Value Are Used

Click the Show Usage button next to the input parameters to find where they are used in the project.

The results are displayed in the Usage Reference Panel.

Modify a Function's Input Parameters

You can modify the input parameter settings of a user-defined function even if the function or its input parameters are already in use.

Specifically, you can:

  • Add input parameters

  • Remove input parameters

  • Rename input parameters

  • Change the types of input parameters

  • Change the return type

Following any of the changes above, Automation Studio automatically modifies all usages of the function or its assets, while making the fewest changes possible.

Example 1: The function is in use

In this example, the function is in use:

If you:

  • Add an input parameter (e.g. Telephone), that parameter will be added to the action:

  • Remove an input parameter (e.g. Name), that parameter is removed from the Start action:

  • Change the name of an input parameter (e.g. ID to Code), the contents of that parameter are not affected:

  • Change the type of an input parameter (e.g. Code from Text to Number), the contents of that parameter in the Start action are removed.

Example 2: The function's input parameters are in use

In this example, the function's Name input parameter is in use within the function itself.

If you:

  • Change the name of the input parameter (e.g. to Full Name), the input parameter is still used to populate the same parameter.

  • Change the type of the input parameter (e.g. to Number), the input parameter is removed from its location in the action.

  • Remove the input parameter from the function, the input parameter is removed from the action.

Example 3: The function's input parameter is used in a For-Each statement

In this example, the function includes an input parameter of type Text List called Children Names.

A For-Each statement within the function itself iterates through that list.

If you:

  • Change the type of that parameter (e.g. to Number List), the list is removed from the For-Each statement.

  • Remove the input parameter, the list is removed from the For-Each statement.

Modify a Function's Return Type

You can modify a function's return type after it has been configured, even if the function or its Return method is already in use.

Following a change to a function's return type, Automation Studio automatically modifies all usages of the function or its assets, while making the fewest changes possible.

Example 1: The function's Return method is in use

In this example, the function's Return method is in use within the function itself.

If you:

  • Change the return type (e.g. from Text to Number), the parameter of the Return method is cleared.

  • Change the return type to None, the parameter of the Return method is removed.

Example 2: The function is used to populate a parameter of another function

In this example, the function is used to populate an input parameter of an Assign function.

If you:

  • Change the function's return type (e.g. from Text to Number), the function is removed from the parameter it was populating.

  • Change the function's return type to None, the function is removed from the parameter it was populating.