06 February 2024

Example – Approve a new admissions programme

The following procedure describes how to build an automated flow in Power Automate to approve a new programme in Reference data. You can also, optionally, build an automated flow to delete programmes that are not approved.

Use Approvals to approve or reject a new programme that is added to Reference data. After the programme is created, an approval request is generated for an applications supervisor. Once approved the programme is approved for use in Admissions. If the approval request is rejected, the status of the programme is set to rejected.

How it works

The image Example flow shows a flow that runs when a new admissions programme is created.

If the approval request is approved, the flow approves the new programme in Reference data. If the approval request is rejected, the flow deletes the programme in Reference data. The key to the image is as follows:

  1. Flow is triggered when a new admissions programme is created in reference data.

  2. Details of the programme are retrieved for the approval process.

  3. Approval request is created and sent to application supervisors.

  4. Details of the programme are retrieved to check there have been no changes to the programme during the approval process.

  5. Approval status of the programme is checked and then actions taken to update the programme status.

Example flow

Approve admissions programme flow

Build the flow

Build the flow as follows:

Retrieve and approve a new programme

Build the flow for approving the new programme as follows:

  1. Create the new flow on Power Automate. On Power Automate, in Flows, select Cloud flows and then New flow and then Automated cloud flow.

  2. On the flow designer, add a trigger to start the flow. Go to searchsearch connectors and triggers and add Tribal - When an entity is created. Define the service and entity as follows:

    • Service is the service that the programme is being created. For example, Admissions.

    • Entity is the type of data being created. For example, Reference data.

  3. Add a filter to trigger the flow only when a new programme is created. Select Show advanced options and then define the following filters:

    • Filters entity -1 to filter the entities by Attribute type equals.

    • Filters value -1 to define the entity created that triggers the flow. For example, admissionsprogramme.

    The image Flow trigger shows the step for triggering the flow when a new programme is created in Reference data.

    Flow trigger
    Trigger for programme flow

  4. Add the action that retrieves the programme details from Admissions. On the flow builder, select + New step and then search for the Tribal - Read an entity action. Select the service and entity as follows:

    • Service is the service that the programme is being created. For example, Admissions.
    • Entity is the type of data being created. For example, Admissions programme.

    Then, define the ID field to using an expression to retrieve the identifier for the programme and transform the identifier to upper case. Note that the identifier must be transformed to upper case for the approval link that is created in the next step.

    For example, the expression toUpper(triggerOutputs()?['body/data/valueIdentifier']) as shown in the image Retrieve programme details.

    Retrieve programme details
    Read an entity step for the entity admissions programme

  5. Add a new step to start and wait for approval. On the flow builder, select + New step and then search for the Start and wait for an approval action.

    For example, to add an approval request using an email, select Show advanced options and then define the following details:

    • Approval type such as Approve/Reject - First to respond.

    • Title defines the subject of the email message that is sent to the designated approver.

    • Assigned to is the email address of the designated approver.

    • Details is the content of the email body and dynamic content relating to the programme, such as Code, Name, and Notes.

    • Item link is the link that enables the approver to view the programme in Admissions.

    • Item link description is the name of the Item link displayed in the email.

    • Requester is the email address that the approval request will be sent from.

    • Enable notifications and Enable reassignment enables you to be informed if the request is forwarded to another recipient.

    The image Programme approval shows the step for starting and waiting for approval from an application supervisor.

    Programme approval
    Approval step for new programme

  6. Add a second step that retrieves the programme details from Admissions. Note that this step must be added to check for any changes made to the programme whilst waiting for approval.

    On the flow builder, select + New step and then search for the Tribal - Read an entity action. Then, define the same Service, Entity, and ID as defined for step 4.

Actions after the programme is approved or rejected

Build the flow steps for the actions after a new programme is approved or rejected as follows:

  1. Add a new step to check the approval status of the programme. On the flow builder, select + New step and then select the Condition - Control action. On the condition, add a New row and select the operator OR. Then, define the following values:

    • approvalStatusCode is equal to A for approved.

    • approvalStatusCode is equal to R for rejected.

    The image Programme approval status shows the approval status step in the flow.

    Programme approved or rejected
    Programme approved or rejected

  2. Define the actions for the If yes branch of the Condition - Control.

    Add an action to post a notification card to a Teams channel stating that the programme has already been approved, bypassing the approval process. On the flow builder, select + New action and then search for the Post a card in a chat or channel action.

    For example, the image If yes branch shows the action to post a notification to a Teams channel that includes the title of the programme and an image in the card body.

    Yes branch
    Programme already approved

  3. Define the actions for the No branch of the Condition - Control.

    Add a new step to check the approval status of the programme. On the flow builder, select + New step and then select the Condition - Control action. On the condition, add a New row and define the value Outcome is equal to approve.

    The image Programme approved shows the approval status step in the flow.

    Programme approved
    Programme approved

  4. Define the actions for the Yes branch of the Condition - Control.

    Add an action to replace the entity and define the following values:

    • Service is the service that the programme is being created. For example, Admissions.

    • Entity is the type of data being created. For example, Admissions programme.

    • ID is the expression toUpper(triggerOutputs()?['body/data/valueIdentifier']) that transforms the GUID to uppercase.

    • If-match is the expression outputs('Read_Admissions_Programme_Post-Approval')['headers']['ETag'] that adds the ETag that must be used to update the admissions programme.

    • Attributes such as schemeCode. You must select the correct dynamic content to match the field. For example, for the field schemeCode you must select the dynamic content schemeCode.

    Then, add an action to post a notification card to a Teams channel stating that the programme has been approved. On the flow builder, select + New action and then search for the Post a card in a chat or channel action.

    For example, the image Yes branch shows the action to replace the entity and post a notification to a Teams channel.

    Yes branch
    Programme approved if yes branch actions

  5. Define the actions for the No branch of the Condition - Control.

    Add an action to post a notification card to a Teams channel stating that the programme has not been approved. On the flow builder, select + New action and then search for the Post a card in a chat or channel action.

    For example, the image No branch shows the action to post a notification to a Teams channel that includes the title of the programme and an image in the card body.

    No branch
    Programme not approved

  6. Test the flow. You can test the flow manually by adding a new admissions programme or automatically when another member of staff adds an admissions programme. Note that any errors with the flow are shown in Power Automate along with troubleshooting guidance.