B.3 ‐ Robotic Process Automation Online Workshop ‐ Power Automate desktop flow Part 5 - dcasota/m365-scripts GitHub Wiki

This is mainly the content from https://learn.microsoft.com/en-us/training/modules/integrate-cloud-flows-online-workshop/optional-exercise-work-queues.

Go to Power Automate and sign in with your credentials.

Within the navigation menu to the left of the screen, select More with the ellipses next to it. Then, select Work queues.

image

This takes the user to the work queues section. Select the + New work queue button or select the +New button at the top of the screen to create a new work queue.

image

In the New work queue panel, enter the following information:

Work queue name: Invoices

Then, select Create.

image

Ensure that you're on the right environment.

Select Invoice Processing Solution created in a previous lab.

image

Select + New from the toolbar at the top. Then, select Automation and Desktop Flow to create a new desktop flow.

image

Name the flow Work Queue Item Load, then select Launch app. You're taken to a new tab in your browser and might need to sign into Power Automate Desktop if prompted.

image

Once in the Power Automate Desktop designer, navigate to the Excel section and select the Launch Excel action to add as the first step of the workflow.

image

In the Launch Excel action, select the Launch Excel parameter dropdown menu and change it to and open the following document. Change the Document path and select the file named Work Queue Vendor Invoice Items from the folder Lab #13 Excel file for Work Queues in the course materials. Select the toggles as shown here to turn off Make instance visible and turn on Open as ReadOnly, then select Save.

image

From within the Excel actions area, select the Read from Excel worksheet action and add as the next step.

image

Select the dropdown menu in the Read from Excel worksheet action for Retrieve and select All available values from worksheet. Then, select Advanced and toggle First line of range contains column names to on. Lastly, select the variable produced and add Invoices to the name of the variable to display as ExcelDataInvoices. Press Save.

image

Navigate to the Loops actions section and select the For Each loop action.

image

Select the variable icon to choose the ExcelDataInvoices variable to iterate over, then edit the name of the variable that the data is stored into to be CurrentInvoice and select Save.

image

Navigate to the Work Queues section in the Action pane and select the Add work queue item action. Ensure to drag the action inside of the For Each loop.

image

Within the dialog box, add the following information, then select Save.

Work Queue: Invoices 
Status: Queued 
Priority: Normal 
Name: %CurrentInvoice['InvoiceItemID']% 
Input: 
Copy 
{ "AccountName": "%CurrentInvoice['AccountName']%", "ContactEmail": "%CurrentInvoice['ContactEmail']%", "Amount": "%CurrentInvoice['Amount']%" }

image

Navigate to the Excel section in the Actions pane and add the Close Excel action as the last step in the flow, outside of the For Each loop. You don't need to make any modifications to this action. Press save.

image

Select the Save button and then select the Run button to run the workflow.

Unfortunately this exercise finished with an inner exception issue "Bad Request - Error in query syntax"

image

Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Fehler beim Hinzufügen eines Arbeitswarteschlangenelements zur Arbeitswarteschlange
   bei Microsoft.Flow.RPA.Desktop.Modules.WorkQueues.Actions.EnqueueWorkQueueItemAction.Execute(ActionContext context)
   bei Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

I tried it again, but this time inside the lab virtual machine with the English version of Windows Server 2025. It completed successfully.

Close the Power Automate Desktop designer window.

Navigate to the Power Automate cloud flow portal at make.powerautomate.com and select More and choose Work Queues from the menu. Notice the 30 queued items for the Invoice work queue.

image

Select the Invoice work queue, and notice the list of items, then choose See all to view the full list of items that are queued by the recently run workflow.

image

Task: Create the Work Queue Item Processor workflow

Return back to Power Automate Desktop.

Select the ellipses for the Enter an Invoice flow created in an earlier lab and select Create a copy from the dropdown list.
Click on Enter an Invoice. Click on Save As. Rename the new flow to: Work Queue Item Processor

image

Select the new flow Work Queue Item Processor and select the pencil icon to edit it.

Navigate to the Work Queues section in the Action pane and select the Process work queue items action. Insert this action after the Run Application step already included in the flow.

Note : This should be the new action 2 in the workflow. Set Invoices work queue.

image

In the Actions pane, search for Json and select the Convert JSON to custom object action, making sure to add inside of the newly created Process work queue item loop.

Select the variable icon {x} to choose the JSON value to convert. From the dropdown list, scroll down and select the expand arrow for WorkQueueItem, then select the .Value option. Click Select to add this to the parameter area.

image

Once added, select Save.

image

Select the Save button at the top of the window.

Select the number 4 in the list of actions to add a Breakpoint to the flow. This Breakpoint stops the flow at the action it's added to, and allows users to view the details of the flow at that stage.

image

Select the Save and Run buttons at the top of the window.

Double-click on the JsonAsCustomObject variable from the Flow variables area in the Variables pane to view the output details from the flow that is running.

image

Notice the data that was parsed from the JSON that can now be used as Name/ Value pairs. Select Close to close out of the window.

image

Select the Stop button at the top of the designer window.

Within the Work Queues section in the Action pane, select the Update work queue item action and drag into the list of actions after the Convert JSON to custom object step inside the for loop. Add the Processing result: Success into the dialog box for Update work queue item and select Save.

image

Select the Save and Run buttons at the top of the window.

Return to the Power Automate web browser at the Invoice Work Queue previously visited. Refresh the browser tab and select See all.

Scroll down to the bottom of the list and notice the item that processed during the previous desktop flow run.

image

Return back to the desktop flow designer and select the Stop button at the top of the window.

Holding down the Ctrl key on your keyboard, select all of the actions from the original Enter an Invoice desktop flow then, drag all of those steps into the Process work queue items loop, between the Convert JSON to custom object and Update work queue item actions.

image

Edit the three steps that Populate text field in window and remove the previously used Input variable to replace the Text to fill in with a value from the parsed JSON stored in the JsonAsCustomObject variable.

Use the following to replace the Text to fill in for each action:

Account Textbox: %JsonAsCustomObject['AccountName']% 
Contact Textbox: %JsonAsCustomObject['ContactEmail']% 
Amount Textbox: %JsonAsCustomObject['Amount']% 

image

If there's a Breakpoint on line 16, remove it. Select Save and Run one final time to see all of the work queue items processed by this flow.

image

Return to the Power Automate cloud portal and notice the completed work queue item runs in the Invoice work queue.

image

Exercise - Use an Outlook email to trigger a desktop flow and pass input

This is mainly the content from https://learn.microsoft.com/en-us/training/modules/outlook-flows-online-workshop/exercise-outlook-trigger-flow.

Select Create from the navigation pane and then select Automated cloud flow.

image

Enter Use Outlook email to trigger Desktop flow in the Flow name field. Search for and select When a new email arrives (V3) - Office 365 Outlook as the trigger event and then select the Create button.

image

In the When a new email arrives (V3) trigger card, I selected change connection.

image

Unfortunately, even with a new login attempt, it did not work.

image

I canceled the create attempt, and selected the connections panel. All connection entries are displayed as connected.

image

I deleted all connection entries, logged out, and rebootet the virtual machine.

I logged-in on the virtual machine with an user account which has local administrative privileges.

After having started Microsoft edge, and browsed to make.powerautomate.com, I logged-in using the account I used in the previous attempt.

This information window is new.

image

The redirection went to the profile page, so I switched to make.powerautomate.com manually, and logged-in again.

The connection entries panel is empty.

image

Now I restarted the procedure from above to create an automated cloud flow.

Again, right after Create, the connection is displayed as invalid. The creation process automatically added a connection Office 365 Outlook, but that one isn't eligible.

image

Because of this and for the moment with lack of ideas how to fix this, I wasn't able to finish the exercise.