{Power 2021} Clear and Update Custom queue field on Case based on Queue items related to the case

Pre-requisites:

  • Should have “Customer Service Hub” app installed in your tenant
  • Add out of box “Case” entity in your solution
  • Create a custom lookup field (Lookup to Queue) titled as “Queue” under Case entity and place it on “Case for interactive experience” form

Requirement:

  1. The Queue to which Case is assigned should get displayed under Queue lookup field
  2. If we are closing the Case as “Resolved” or “Cancel” – Queue lookup field should be set to null

Implementation:

Now, we are creating an “Automated Cloud flow” to implement above 2 requirements mentioned above:

  • Open Solution >> Select Cloud flow from left navigation (Make sure you have selected the correct environment)
  • Click on drop-down arrow next to “New” button >> Select “Automation” >> then select “Cloud Flow” >> then select “Automated Cloud flow
  • Now, give name to your Cloud flow and select the trigger action of Microsoft Dataverse i.e., “When a row is added, modified or deleted”. In our scenario, we are triggering our flow if a Case is added to Queue which means whenever a Queue Item has been created under respective Queue. Then, click on Create.
  • Rename the trigger action as “Whenever a Queue Item record is created or modified.
  • Select “Added or Modified or Deleted” under Change type
  • Select “Queue Items” under Table Name
  • Select “Organization” under Scope
  • Enter “statuscode” (which is logical name of Status field of Queue Item table) under Select Columns

Then click on “New Step”

  • Now, select “Get a row by ID” to get Case details and select “Cases” under Table Name and “Object (Value)” under Row ID. Select “New Step”.
  • Now, select “Get a row by ID” to get Queue Item details and select “Queue Item” under Table Name and “Queue Item” (unique identifier) under Row ID. Select “New Step”.
  • Now, select “Get a row by ID” to get Queue details and select “Queue” under Table Name and “Queue (Value)” under Row ID. Select “New Step”.
  • Select the “Condition” and add the condition where if Status (Queue Item) is equal to “0” i.e., Active. If the condition will be true, “Yes” part of the condition will be continued else it will go under “No” part
  • Click on “Add an action” under “Yes” part and select “Update a record” action.
    • Select “Cases” under Table Name
    • Select “Case” (Unique Identifier) under Row ID
    • Add “queue(QueueValue)” under Queue field

Scroll down a little and see the option of Queue.

  • Click on “Add an action” under “No” part and select “Update a record” action.
    • Select “Cases” under Table Name
    • Select “Case” (Unique Identifier) under Row ID
    • Add null expression under Queue field

Scroll down a little and see the option of Queue.

  • You may now save and test the flow.

Testing:

  • Create a case record by clicking on “New Case” button.
  • Add a Case to Queue by clicking on “Add to Queue” button from ribbon. Here I have a “Test” Queue, so I am using that
  • Now, Queue field which is placed under Case form should be auto populated with respective Queue.
  • Now, click on “Resolve” or “Cancel” option from ribbon
  • Now, check record becomes read-only, and the Queue field is automatically be set to null.

Hope it helps and Power 365ing as usual!

Other ways to learn with me:

clip_image009

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

Me and my team are here to assist, Please fill the following form for your business needs: Click here

clip_image011

One thought on “{Power 2021} Clear and Update Custom queue field on Case based on Queue items related to the case

Leave a comment