Add Tracepoints to Your Data Action

Add tracepoints to your data action steps to determine where you want to look at for intermediate results of the data action.

Prerequisites

Create a data action that includes various steps as you desire.

To add or delete tracepoints for a data action, you must have the Create and Update permissions for the Data Action item.

Context

Data action tracing is especially powerful for advanced formulas steps and gives you a smooth debugging experience just like you have when you’re coding and troubleshooting. The procedure below is laid out centered around an advanced formulas step. You can also add tracepoints before the first data action step, after the last data action step, or between data action steps.

Procedure

  1. In the script editor of the data action page, click in the left margin next to a line number of advanced formulas scripts to add a tracepoint.

    The tracepoint indicator will then be briefly visible before fading out. It will be visible again when you hover over the tracepoint.

    Note

    A tracepoint is added at the beginning of a calculation, as illustrated by it being placed next to the line number. But where the actual tracing applies is at the end of the calculation, as illustrated by the tracepoint indicator.

    You can add tracepoints any time you like, either in saved or edit mode for your data action. Note there are differences:

    Add tracepoints in saved mode

    Tracepoints will be automatically saved.

    Tracepoints can’t be added to statements not supported by tracing. If you try to add a tracepoint to such a statement, nothing is shown when you click in the left margin next to the line number.

    A tracepoint can only be added at the beginning of a calculation. Tracepoints added elsewhere will be automatically moved up to the beginning of the calculation.

    Tracepoints take the form of red filled circles.

    Add tracepoints in edit mode

    Tracepoints will not be saved until you save your data action.

    Tracepoints can be added anywhere as your data action has not been validated and saved. Tracepoints added to statements not supported by tracing will be removed after you save your data action.

    Tracepoints added anywhere other than the beginning of a calculation will be moved up after you save your data action.

    Tracepoints take the form of empty circles.

    Here is an example of adding tracepoints in saved mode:

    In saved mode, tracepoint can't be added to statements not supported by tracing (Line 5 and Line 7). The last two attempts of adding tracepoints are successful. Note that since the calculation starts from Line 12, the tracepoint added to Line 13 is automatically moved up to Line 12. All the tracepoints successfully added are automatically saved.

    Here is an example of adding tracepoints in edit mode:

    In edit mode, tracepoint can be added anywhere, but they are not saved. After the data action is saved, tracepoints added to unsupported statements are removed (Line 5 and Line 7), and the tracepoint added to Line 13 is moved up to Line 12. All the tracepoints successfully added are now saved.

    The number of tracepoints added for an advanced formulas step or embedded data action step will be shown on its step name entry in the left pane of the data action page.

    Note

    The maximum number of tracepoints allowed for a data action is set to 20 by default in tenant configurations. Note that this also takes into account the tracepoints added for all its embedded data action steps.

    Note

    Tracepoints are not affected when you undo or redo changes to your data action.

    Note

    Tracepoints are not available in the visual tool for advanced formulas steps.

    If you select to add a tracepoint that falls inside a loop in an advanced formulas step, proceed as follows:

    1. Set the conditions for the loop by selecting dimension members (in the case of FOREACH loop) or setting variable values (in the case of FOR loop) in the Conditional Tracepoint dialog.

      If the tracepoint falls within multiple loops, you need to set multiple conditions.

    2. Select OK to confirm the conditions.

      The conditions for the loop are set and saved. The (Edit Condition) icon will appear for the tracepoint in the Tracepoints section of the tracing panel (Refer to Step 4 on how to open the tracing panel). You can click this icon to edit the loop conditions.

    Note

    The maximum number of traced iterations in a loop is set to 10 by default in tenant configurations, which means only tracing results of 10 iterations are available.

    Note

    If you add a tracepoint that falls inside a loop for your data action in edit mode, the Conditional Tracepoint dialog won’t appear. After you save your data action, the warning button of Condition Missing will appear for the tracepoint in the Tracepoints section. You can click this icon to set conditions. If you don’t do so, tracing will run with the default conditions.

  2. To add tracepoints before the first data action step, after the last data action step, or between steps, click the connector between steps in the left pane of the data action page.
  3. Optional: To remove a tracepoint, just click it again.
  4. Click (Open Tracing Panel) in the toolbar to open the tracing panel.

    You can see the list of all tracepoints in the Tracepoints section.

    If you hover over a tracepoint in the Tracepoints section, the (Delete Tracepoint) icon will appear. You can click it to remove the tracepoint.

    Note

    You can also open the tracing panel before adding any tracepoints, or anytime you like. If no tracepints have been added, you can see text and an animation explaining how to add tracepoints in the Tracepoints section.

  5. Optional: To select a tracepoint, click on the list of all tracepoints in the Tracepoints section.

    The selected tracepoint will be highlighted in the script editor.

    Selecting a tracepoint in another step this way will navigate to that step.

Results

All your desired tracepoints are added and saved.

Next Steps

You can proceed to run tracing, that is, run your data action in trace mode.