5 Lab 4 Mani Use Input and Output Variables

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Robotic Process

Automation in a Day
Lab 4 – Use Input and Output variables
30 mins
June 2022
This document is provided “as-is.” Information and views expressed in this document, including
URL and other Internet Web site references, may change without notice. You bear the risk of
using it. Some examples are fictitious and are for illustration only. No real association is intended
or inferred. This document does not provide you with any legal rights to any intellectual property in
any Microsoft product. You may copy and use this document for your internal reference purposes.

© 2022 Microsoft Corporation. All rights reserved.

© 2022 Microsoft Corporation. All rights reserved 2


Lab Overview
In the previous lab you created your first desktop flow that can automate entering a new invoice
with fixed parameter values for Contoso Coffee shop. However, in reality your automation
should be using real input variables instead of fixed values and it is likely that you will need to
capture real time output from the automation running result as well.
In this lab, you will complete the following tasks:
• Create a new Power Automate desktop flow with predefined inputs
• Record actions performed in the desktop-based Contoso Invoicing application using
these inputs, and capturing application data for output
• Perform a test run of the new desktop flow with a new set of inputs

Prerequisites
This lab builds on the initial setup lab (Lab 1) – ensure all tasks are complete.

Important Additional Prerequisite: As you will be recording actions performed in your UI in


this lab, you will have the best experience if you view the lab instructions on a separate
device or in a printout. You can still complete the lab while pursuing the instructions during UI
action recording, however, you will have to perform extra work to cut the recorded actions of
viewing the instructions from your flow.

© 2022 Microsoft Corporation. All rights reserved 3


Use input and output parameters

1. First let us open the desktop flow that you have created in the previous lab. You can
open it from Power Automate for desktop app directly, or you can open it from the
browser from Power Automate website. Here we will show you the steps of opening
from the browser. Open the test profile in a browser and navigate to
https://powerautomate.microsoft.com

2. Open Contoso Invoicing app.

3. Select My flows > Desktop flows.

© 2022 Microsoft Corporation. All rights reserved 4


4. Edit Enter an invoice flow by hover mouse over and clicking the Edit icon

5. Click Launch app.

6. Power Automate for desktop provides the ability to receive input values from Cloud
flows and return values using output values.

We will now create a series of input values. Move the mouse over the Input/output variables

area, then click the plus sign icon and choose Input option to add your first input.

© 2022 Microsoft Corporation. All rights reserved 5


7. In the pop-up window, use the values below to set up the first input variable:

• Variable Type: Input


• Variable Name: Amount
• Data type: String
• Default value: $500
• External Name: Amount
• Description: Amount

© 2022 Microsoft Corporation. All rights reserved 6


8. Click Create.

9. Repeating to click the plus sign then select Input to add 2 more input variables.

© 2022 Microsoft Corporation. All rights reserved 7


10. Use these values to set up two new added inputs.

• Variable Type: Input


• Variable Name: Contact
• Data type: String
• Default value: [email protected]
• External Name: Contact
• Description: Contact email

© 2022 Microsoft Corporation. All rights reserved 8


• Variable Type: Input
• Variable Name: Account
• Data type: String
• Default value: WingTip Cups
• External Name: Accountname
• Description: Account name

© 2022 Microsoft Corporation. All rights reserved 9


11. Click Save.

12. On the right-side Input/output variables area, click the plus icon and select
Output option to add your first output variable.

© 2022 Microsoft Corporation. All rights reserved 10


13. Use these values to set up the first output:

• Variable Type: Output


• Variable Name: InvoiceID
• External Name: InvoiceID
• Description: InvoiceID

© 2022 Microsoft Corporation. All rights reserved 11


14. After providing the required values in each field, click Create to proceed.

15. Within our process, we now need to add an action to set this output. Please ensure the
Contoso Invoicing application is still running. Drag the Get details of a UI element’s
attribute in a window action from the tree view menu under UI automation > Data
extraction folder after Step 8 in your actions.

© 2022 Microsoft Corporation. All rights reserved 12


16. In the pop-up window, click the UI element dropdown and then click Add a new UI
element.

© 2022 Microsoft Corporation. All rights reserved 13


Note: After you click Add UI element, you will see a red rectangle appears on the screen while
you are hovering the mouse over the elements.

17. Go to Contoso Invoicing app, move the mouse over the value that belongs to ID
number. Hold the CTRL key on your keyboard and then press Left-Click on your mouse
to select the element (Note: you may see a different ID number than the number
displayed here).

© 2022 Microsoft Corporation. All rights reserved 14


18. Once you select the element, you will see the Text value appeared in tracking session.
Click Done.

© 2022 Microsoft Corporation. All rights reserved 15


19. Back to the pop-up window and click Save.

Note: This action will automatically produce a variable called AttributeValue that we can refer
to in subsequent actions within Power Automate for desktop. You can see it from the pop-up
window. You can also click on it to rename the variable if you want to.

20. We will now set the InvoiceID output variable. This allows us to use the Invoice ID in
downstream processes or from our cloud flow in a future lab.
Drag and drop a Set variable action from the tree view under Variables folder to below Step 9
(which is the Get details of a UI element in window that we just created).

© 2022 Microsoft Corporation. All rights reserved 16


Use the information below to fill out Set variable:
• Set: %InvoiceID%
• To: %AttributeValue%

Note: You can also use the {x} button to browse and select AttributeValue from the dropdown
list.

© 2022 Microsoft Corporation. All rights reserved 17


21. Click Save to complete this step.

22. Now we will configure the steps to use input variables values when running the
automation. Double click on Step 5 (Edit ‘TextBox’ with ‘WingTip Cups) to open to edit.
Or select Step 5, then click the … icon and select Edit.

23. In the pop-up window, first delete the value in Text to fill-in field.
24. Now select the Account (one of the input variables that we created earlier) by first
clicking the {x} icon and then double clicking to select Account.

© 2022 Microsoft Corporation. All rights reserved 18


25. Click Save.

© 2022 Microsoft Corporation. All rights reserved 19


26. Repeat the same steps above to change the value in Text to fill-in in Step 6 and Step 7.
• Use Input variable “Contact” for Step 6
• Use Input variable “Amount” for Step 7

27. Once you are done, your actions should look like the screenshot below.

© 2022 Microsoft Corporation. All rights reserved 20


© 2022 Microsoft Corporation. All rights reserved 21
28. Click Save to save your desktop flow.

29. Now you have complete configuring using inputs and outputs in your desktop flow. In
the next labs, we will use those inputs and outputs to pass data value between cloud
flows and desktop flows. Now you can test your flow by clicking Run and watch the
automation running using the input variables values (default values).

© 2022 Microsoft Corporation. All rights reserved 22


Check your knowledge
Lab 4
2 mins
1. If you need to pass parameters from a cloud flow into a desktop flow, where do you
define these values?

A. Run
B. Run next action
C. Input/output variables
D. None of the above

Answer: C. Input/output variables allow the maker to establish parameters that can be
sent from a Cloud flow. In addition, output variables can be used to send data back to
Cloud flows.

2. We need to hold the _______ key on keyboard and then _______ to select the UI element in
Power Automate for desktop.

A. Shift + Right-Click
B. Shift + Left-Click
C. CTRL + Left-Click
D. CTRL + Right-Click

Answer: C. CTRL + Left-Click

3. Which of the following actions allows us to use Invoice ID in downstream desktop flow
actions or is required to return the value to a cloud flow?

© 2022 Microsoft Corporation. All rights reserved 23


A. Create a new list
B. Set variable
C. Add item to list
D. Increase variable

Answer: B. Set variable – We can set an output type of variable which will capture the
Invoice ID. It will allow us to use the Invoice ID in downstream processes or send back to
our cloud flow that will be created in a future lab.

© 2022 Microsoft Corporation. All rights reserved 24


Information in this document, including URL and other Internet Web site references,
is subject to change without notice. Unless otherwise noted, the example companies,
organizations, products, domain names, e-mail addresses, logos, people, places, and events
depicted herein are fictitious, and no association with any real company, organization, product,
domain name, e-mail address, logo, person, place, or event is intended or should be inferred.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting
the rights under copyright, no part of this document may be reproduced, stored in, or
introduced into a retrieval system, or transmitted in any form or by any means (electronic,
mechanical, photocopying, recording, or otherwise), or for any purpose, without the express
written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you
any license to these patents, trademarks, copyrights, or other intellectual property.
The names of manufacturers, products, or URLs are provided for informational purposes only
and Microsoft makes no representations or warranties, either expressed, implied, or statutory,
regarding these manufacturers or the use of the products with any Microsoft technologies.
The inclusion of a manufacturer or product does not imply endorsement of Microsoft of the
manufacturer or product. Links may be provided to third party sites. Such sites are not under the
control of Microsoft and Microsoft is not responsible for the contents of any linked site or any
link contained in a linked site, or any changes or updates to such sites. Microsoft is not
responsible for webcasting, or any other form of transmission received from any linked site.
Microsoft is providing these links to you only as a convenience, and the inclusion of any link
does not imply endorsement of Microsoft of the site, or the products contained therein.
© 2022 Microsoft Corporation. All rights reserved.
Microsoft and the trademarks listed at
https://www.microsoft.com/enus/legal/intellectualproperty/Trademarks/Usage/General.aspx
are trademarks of the Microsoft group of companies. All other trademarks are the property of
their respective owners.

© 2022 Microsoft Corporation. All rights reserved 25

You might also like