Before testing our sub-workflow, we'll add the necessary actions to send an email to the user who filled out the form. This ensures they receive confirmation or relevant information about the workflow's execution via the feedback_message.
Video (11:55 Minutes)
Log into Rewst and complete the following steps
Step 1: Identifying the User Who Filled Out the Form
Add the Microsoft Graph Get User action in the parent workflow
Connect the On Success transition to update_groups
Select the action
Rename the action "get_user"
Select the On Success transition of get_user
Create a Data Alias
Name:target_user
Value: {{ RESULT.result.data.value }}
Step 2: Collecting Feedback Messages
Add a noop below update_groups
Connect the On Success transition of update_groups to the noop.
Rename the noop "list_feedback_messages"
Create a Data Alias
Name: feedback_message_list
Value:
{{-
[
message.result.feedback_message
for message in TASKS.update_groups.collected_results
]
-}}
Step 3: Sending the Email of Feedback Messages
Add the sendmail action below list_feedback_messages
Connect the On Success transition from list_feedback_messages to sendmail.
Rename the action to send_mail
Select send_mail
Configure send_mail
Recipient:{{ CTX.user.username }}
Subject: Your request to update Microsoft Groups for the User {{ CTX.target_user.displayName | d }}.
Title: Your request to update Microsoft Groups for the User {{ CTX.target_user.displayName | d }}.
Message: Here are the results of your request to update Microsoft Groups for the User {{ CTX.target_user.displayName | d }}.
{{ CTX.feedback_message_list | join("\n* "}}
Action Item
With actions that implement With Items, test the Collected Results and use Publish Result As to simplify managing collected_results of actions.