Skip to main content
insightsoftware Docs insightsoftware Docs
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

Using Macros

Macros can be used in combination with automation tasks to add additional metadata to the export result. You can use macros directly in the datastore and task definition, as well as in the following config items:

  • Filename (Export to CSV, Excel, and HTML)
  • Sheet name (Export to Excel)
  • Table name (Export to SQL)
  • Email subject (All datastore types)
  • Email message (All datastore types)

Available Macros

The following macros are available:

{angleid}*

The ID of the exported Angle.

{anglename}

The name of the exported Angle.

{anglename:normalized}

The normalized name of the exported Angle. All spaces and special characters used in the Angle name will be removed.

{condition}

The condition for condition based automation task.

{conditionresult}

The condition result for condition based automation task.

{displayid}

The ID of the exported Display.

{displayname}*

The name of the exported Display.

{displayname:normalized}

The normalized name of the exported Display. All spaces and special characters used in the Display name will be removed.

{displayuri}*

The resource locator of the Display.

{language}

The language of the exported data.

{model}

The ID of the model the Angle is part of.

{modeltimestamp}

The timestamp of the model the exported Angle is part of.

{objectcount}

The amount of objects in the export.

{result}

The contents of the exported Display.

{rowsexported}

The number of rows exported for this Angle.

{rowstotal}

The number of rows available in the Display.

* This macro should not be used in filenames, because it can contain special characters which can cause errors during the export.

How to use Macros

In the following example, you can see how to use macros in the settings of both Datastores and Automation Tasks.

Example

In this example, we create an automated export to CSV of the Angle "Controlling Cost Totals". The following needs should be met:

  • The export should be sent to your email address daily.
  • The name of the CSV file should be the normalized Angle name.
  • The Angle name should be mentioned in the subject of the email message.
  • The model timestamp and the Display name should be mentioned in the body of the email message.

To set up the automated export using macros

  1. Open the IT Management Console.

  2. Navigate to Automation tasks > ​​​Datastores​.

  3. Click Add new datastore.

  4. Select the Export to CSV datastore and click OK.

  5. Enter your desired settings for the CSV export. In the File name field, add the macro {anglename:normalized} to make sure that the filename of the resulting CSV file is the normalized Angle name.

  6. Click Save.

  7. Navigate to Automation tasks > ​​​Tasks​​.

  8. Click Add task.

  9. Enter the desired settings for the task.

  10. Click Add action.

  11. Enter the url of the "Controlling Cost Totals" Angle (see Define Angle Automation tasks).

  12. Select the Datastore that you created in a previous step and configure its settings.

  13. Select Send a notification after the task has finished. The Email settings section expands.

  14. Click Add recipient and enter your e-mail address. Select which e-mails you want to receive (Result, Success, Failure).

  15. Enter the subject and include the {anglename} macro. The Angle name is now always part of the subject line.

  16. Create the body of the e-mail and include the {modeltimestamp} and {displayname} macros. MC_AutoTask_MacroExample

  17. Click OK to save the action.

  18. You will now receive e-mails that look as follows: MC_AutoTask_MacroResult

Published:

Using Macros

Macros can be used in combination with automation tasks to add additional metadata to the export result. You can use macros directly in the datastore and task definition, as well as in the following config items:

  • Filename (Export to CSV, Excel, and HTML)
  • Sheet name (Export to Excel)
  • Table name (Export to SQL)
  • Email subject (All datastore types)
  • Email message (All datastore types)

Available Macros

The following macros are available:

{angleid}*

The ID of the exported Angle.

{anglename}

The name of the exported Angle.

{anglename:normalized}

The normalized name of the exported Angle. All spaces and special characters used in the Angle name will be removed.

{condition}

The condition for condition based automation task.

{conditionresult}

The condition result for condition based automation task.

{displayid}

The ID of the exported Display.

{displayname}*

The name of the exported Display.

{displayname:normalized}

The normalized name of the exported Display. All spaces and special characters used in the Display name will be removed.

{displayuri}*

The resource locator of the Display.

{language}

The language of the exported data.

{model}

The ID of the model the Angle is part of.

{modeltimestamp}

The timestamp of the model the exported Angle is part of.

{objectcount}

The amount of objects in the export.

{result}

The contents of the exported Display.

{rowsexported}

The number of rows exported for this Angle.

{rowstotal}

The number of rows available in the Display.

* This macro should not be used in filenames, because it can contain special characters which can cause errors during the export.

How to use Macros

In the following example, you can see how to use macros in the settings of both Datastores and Automation Tasks.

Example

In this example, we create an automated export to CSV of the Angle "Controlling Cost Totals". The following needs should be met:

  • The export should be sent to your email address daily.
  • The name of the CSV file should be the normalized Angle name.
  • The Angle name should be mentioned in the subject of the email message.
  • The model timestamp and the Display name should be mentioned in the body of the email message.

To set up the automated export using macros

  1. Open the IT Management Console.

  2. Navigate to Automation tasks > ​​​Datastores​.

  3. Click Add new datastore.

  4. Select the Export to CSV datastore and click OK.

  5. Enter your desired settings for the CSV export. In the File name field, add the macro {anglename:normalized} to make sure that the filename of the resulting CSV file is the normalized Angle name.

  6. Click Save.

  7. Navigate to Automation tasks > ​​​Tasks​​.

  8. Click Add task.

  9. Enter the desired settings for the task.

  10. Click Add action.

  11. Enter the url of the "Controlling Cost Totals" Angle (see Define Angle Automation tasks).

  12. Select the Datastore that you created in a previous step and configure its settings.

  13. Select Send a notification after the task has finished. The Email settings section expands.

  14. Click Add recipient and enter your e-mail address. Select which e-mails you want to receive (Result, Success, Failure).

  15. Enter the subject and include the {anglename} macro. The Angle name is now always part of the subject line.

  16. Create the body of the e-mail and include the {modeltimestamp} and {displayname} macros. MC_AutoTask_MacroExample

  17. Click OK to save the action.

  18. You will now receive e-mails that look as follows: MC_AutoTask_MacroResult

For an optimal Community experience, Please view on Desktop
Powered by Zendesk