Use the Compose and Variable actions to view data

Completed

Occasionally, scenarios occur where the flow runs successfully but you don't get the results that you intended because of the flow. These situations are when using the Compose and Variable actions helps.

Compose action to view data created by a previous action

The Compose action constructs an arbitrary object from the user's input based on an action.

Screenshot of the Choose an operation dialog box with search results for Compose.

For example, you want to see the timestamp format that is generated by the Manually trigger a flow trigger. Consequently, you add the Timestamp dynamic content to the Compose action.

Screenshot of the Compose action with the dynamic content Timestamp being selected for the Inputs box.

You can rename the action to add some meaningful text.

Screenshot of the ellipsis button selected and the Rename option highlighted.

Now, when you save and run this flow, the timestamp format will show, which isn't the desired outcome.

Screenshot of the flow with a Your flow ran successfully message and a raw date time output.

You can now use the formatDateTime expression to get the format that you need.

Screenshot of the Compose action to convert the timestamp format.

Variable action to view appended data

Consider a scenario where you want to send a single approval action to multiple users. The data is stored in a list in Microsoft Lists with a Title column, which is a single line of text, and approvers, which is a people and groups column. The approvers have a multiple selection option.

Screenshot of the Settings > Edit Column dialog box with the Allow multiple selections option set to Yes and the Allow selection of option set to People only.

To view all names of all approvers that have been selected, you will initialize a variable.

Screenshot of the Choose an operation dialog box with Initialize variable selected.

Assign the variable a name and then set it as type String.

Screenshot of the Initialize variable action with Type set to String.

Search and select the Append to string variable action.

Screenshot of the Choose an operation dialog box with Append to string variable selected.

Now, you can append the email addresses of all approvers' emails.

Screenshot of the Append to string variable dialog box with dynamic content Approvers Email selected for the value.

This action will automatically count how many approvers have been added and then append them, one at a time, to the string variable.

Screenshot of the Apply to each action showing three of three.