3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

A hands-on scenario - Automatic invoice processing by Power Automate Cloud Flow and Desktop Flow

Last updated at Posted at 2021-12-17

Hi, my name is Yuto Kawabata, GBB Technical Specialist at Microsoft.

In this hands-on I will go through how we can automate and make our processes efficient by utilizing Power Automate Cloud Flow and Desktop Flow in an approval scenario.
Let me pick up a use case for how to automate approval seeking from manager and invoice processing as shown a slide image below.

1.Premises

  1. Click the link below and log in with your user id/email address.
    https://flow.microsoft.com/
    image.png

  2. The screen will look like this.
    image.png

2.Create an Approval Process by Cloud Flow

Go to https://flow.microsoft.com/

Select "Automated cloud flow" as below.
image.png

Then a new pop-up window will appear.
Select "When a new email arrives(V3)". You can set the name of the Flow to whatever you like, e.g. Automatic invoice processing.
image.png

Then click on "Create".
image.png

*If you are new to the operation described above, you would need to make sure that you have authentication setting for Outlook connector first.
*If you get any popups/instruction tips for first time users appear, you can dismiss them or proceed upon your preference.

For convenience, in this scenario please set your email address in "From" setting.
image.png

Click on "+ New step" to add to the process.
You can search by "approval" and select "Start and wait for approval"
image.png

Then you can select the approval type option. Select "Approve/Reject - Everyone must approve"
image.png

You can set the title to anything you like, for example "Approval Request". Add "Assigned to" by selecting Dynamic content you can specify contents from previous trigger/actions.
image.png

In Details section you can specify "Body" from the Dynamic content selection.
image.png

The "Approvals" action takes around 5 minutes to prepare its database when it comes to run only for the first time creation in Power Automate. Try to run a prompt flow including this action tentatively.
image.png

For utilizing "Approval" action first, you can add "Terminate" Control and specify "Succeeded" in the Status option.
image.png

Please try to send an email with a body text below for instance. You can utilize below by copy & paste in your Outlook email body (the body should be in a format of Text, not HTML in Outlook email).

2021/10/12 9:46:14
〇〇 Corporation
marumaru@corporate.com
$100,000
Unclaimed

Now you can see the running status successfully in a history log (it would take some minutes to get reflected until when you create the first approval trigger) and you get notification like below to get your approval (Please feel free to try Approve or Reject here).

image.png

image.png

I hope it works now in your environment!

Add Condition in Control in between the "Approval" and "Terminate" actions.
image.png

Specify Condition in Control action.
image.png

Now you can see 2 condition branches, "If yes" and "If no".
image.png

Populate "Outcome" in a dynamic value and "Approve" as a direct inputted text in a condition of "is equal to".
image.png

Add a Teams action
image.png

Select "Post message in a chat or channel".
image.png

Populate items like below.
Post as:Flow bot
Post in:Chat with Flow bot
Recipient: From (a dynamic content)
Message: To (a dynamic content) approved this request; Body (a dynamic content)

image.png

Similarly you can set a condition branch of "If no", let you select "Copy to my clipboard" and duplicate the content from one branch to another.
image.png

In order to copy the condition of Teams please select "My clipboard" and the copied action content as below.
image.png

Edit items similar to the copied part like below.
Post as:Flow bot
Post in:Chat with Flow bot
Recipient: From (a dynamic content)
Message: To (a dynamic content) denied this request; Body (a dynamic content)
image.png

Let's check how it works when your manager (now you can make yourself as an approval for the testing convenience).

The overall settings now should be like below.
image.png

3.Create a Desktop Flow to input data to legacy application automatically ※RPA license for Power Automate for desktop needed

Premises for Desktop Flow; Applications to set up

Create a Desktop Flow

Create a new desktop in your client PC env. I will name the cloud flow "Invoicing data input from cloud flow".
image.png

Add Input/output variables in + button on the right menu.
image.png

Proceed it in default setting for Input variable from the cloud flow.
image.png

Add "Split text" action first.
- Text to split:%NewInput%
- You can specify this from {x} button set by Input variable.
- Standard delimiter: New line
image.png

Now you could split the lines of below by new lines.

2021/10/12 9:46:14
〇〇 Corporation
marumaru@corporate.com
$100,000
Unclaimed
  • TextList[0]
    • Populate first item of the list, such as "2021/10/12 9:46:14".
  • TextList[1]
    • Populate second item of the list, such as "〇〇 Corporation".
  • TextList[2]
  • TextList[3]
    • Populate fourth item of the list, such as "$100".
  • TextList[4]
    • Populate fifth item of the list, such as "Unclaimed".

You can set the desktop flow as you like, here is one of examples.
image.png

Add an action of Desktop Flow in Cloud Flow

In order to communicate from Cloud Flow to Desktop flow, please add an action of desktop flow which you created in the previous section.
image.png

Select the desktop flow which you created just now.
image.png

Populate items as below
- Desktop flow: Specify the created flow name.
- Run Mode: Attended
- NewInput: Body (a dynamic content)
image.png

4.Let's run the overall process and check how it goes.

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?