Automate Business Email Management Using AI Builder and Power Apps: Step-by-Step Guide
Published Jul 21 2023 12:00 AM 5,954 Views
Iron Contributor


Welcome to our comprehensive blog on efficient inbox management!

If you've ever found yourself drowning in a sea of emails, struggling to prioritize and respond to critical messages, this guide is tailor-made for you. We'll walk you through a step-by-step Low-Code to No-Code journey, leveraging the power of AI and Power Apps to streamline your email handling process.


Imagine having a dedicated inbox for Feedback, Issues, or your usual emails, and being able to automatically categorize them based on their importance. No more sifting through countless messages or missing crucial communications. Whether you're a busy professional, a startup entrepreneur, or just someone seeking better email organization, we've got you covered.

With a Microsoft 365 subscription and a Power Apps Developer Plan in hand, you'll embark on a journey to create your own Power Application and seamlessly connect it to Outlook and AI Builder. We'll guide you through the process, ensuring that you have all the tools and knowledge needed to tackle your inbox chaos effectively. So, let's get started on the path to reclaiming control over your email management. By the end of this blog, you'll be equipped with the skills to efficiently manage your inbox, focus on the emails that truly matter, and respond to them right from the Power Apps interface. Get ready to revolutionize your email experience!

 

Scenario

Do you have a dedicated inbox for Feedback, Issues, or even your normal Inbox that you usually use?
Have you ever gotten frustrated with the number of emails you receive on a daily basis and don't have time to review all of them?
Are you starting your new business and you are short on staff?

If your answer is yes to any of the previous questions then, you need something to
 help you manage your inbox and address only the critical emails.

 

In this blog, we will go through a step-by-step Low-Code to No-Code guide, from creating our Power Application to connecting it to Outlook, and AI Builder and then testing it out.

 

Prerequisites:

A Microsoft 365 subscription, you can sign up for a Microsoft 365 Developer account.

A Power Apps Plan, you can sign up for a Power Apps Developer Plan.

A Power Apps Environment.

Canvas App Zip File from GitHub.

 

Summary of the steps:

Step 1: Open Power Apps and Create a new Canvas App.

Step 2: Add Microsoft Office 356 Outlook Connector.

Step 3: Add AI Builder Sentiment Analysis Model Connector.

Step 4: Create the Browse Emails Screen.

Step 5: Create the Detailed View Screen.

Step 6: Create the Respond Screen.

Step 7: Test and Publish the Application.

 

Step 1: Open Power Apps and Create a new Canvas App

Open Power Apps Studio using this link make.powerapps.com then Click on Apps.

1.png


Click
on + New App and Choose Canvas to create our application

2.png


Enter
a Name for your Application and Click on Create

3.png


Now we have our canvas Ready to work inside it.

4.png

 

Step 2: Add Microsoft Office 356 Outlook Connector

A Power Platform connector is a proxy or a wrapper around an API that allows the underlying service to talk to Microsoft Power Automate, Microsoft Power Apps, and Azure Logic Apps. It provides a way for users to connect their accounts and leverage a set of prebuilt actions and triggers to build their apps and workflows. (Learn more: here)

Click on Data from the Left Navigation Menu then, Click on Add Data then, Choose Connectors then, Choose Office 365 Outlook Connector.

Or Search for it using the Search Bar after you Click on Add Data the name of the connector is "Office 365 Outlook".

5.png


Then Click on + Add Connection to Add a new Connection to your Outlook Account.

6.png


Then Click on Connect.

7.png


Now we have access to our Outlook account from PowerApps.

 

Note: If your email is not dedicated to Feedback or you want to analyze specific emails.

You need to create a Folder for the emails you want to analyze inside your Outlook and Add Emails to it for our demo I used a folder named "Feedback".

Instead of adding emails manually, you can use a rule to detect all the emails that have the word feedback in their subject and move them to your folder.


Whatever works for you. (Learn more: here)


Go to outlook.office.com Click on Settings then, Mail then, Rules then, + Add new rule.

8.png

 

Step 3: Add AI Builder Sentiment Analysis Model Connector

AI Builder is a Microsoft Power Platform capability that provides AI models that are designed to optimize your business processes. With AI Builder, you don't need coding or data science skills to access the power of AI. (Learn more: here)

9.png


Back inside our Canvas App.

Click on Data from the Left Navigation Menu then, Click on Add Data then, Choose AI Models then, Click on See all models then, Choose Sentiment analysis model or Search for it using the Search Bar after you Click on Add Data the name of the model is "Sentiment analysis".

10.png


Now we can use the sentiment analysis prebuilt model to predict the sentiment of text inside PowerApps.

The sentiment analysis prebuilt model detects positive or negative sentiment in text data. You can use it to analyze social media, customer reviews, or any text data you're interested in. Sentiment analysis evaluates text input and gives scores and labels at a sentence and document level. (Learn more: here)

Step 4: Create the Browse Emails Screen

Rename the Screen and Name it BrowseScreen1

1. Create the Navbar Background
Insert ⇒ Rectangle then Resize it to fit the screen ⇒ Rename it to Navbar

Create Navbar.gif


2. Create the App Label

Insert ⇒ Text Label then Resize it to fit the Navbar

  • Add the following Properties:
    • Text  ⇒ Analyze Emails
    • Font ⇒ Segoe UI
    • Font Size ⇒ 40
    • Font weight ⇒ Bold
    • Color ⇒ White

11.png


3. Create the Search Bar

Insert ⇒ Text Input then Resize it to fit the Navbar

  • Add the following Properties:
    • Default ⇒ No Value
    • Hint Text ⇒ Search Items
    • Font ⇒ Segoe UI
    • Font Size ⇒ 20
    • Padding ⇒ Left ⇒ 80
    • Border ⇒ None
    • Border Radius ⇒ 0
    • Tooltip ⇒ Search Items

12.png

13.png


4. Create the Search Icon

Insert ⇒ Search Icon then Resize it to fit the Search Bar

  • Add the following Properties:
    • Color ⇒ Gray

14.png


5. Create the Combo Box
Insert ⇒ Input ⇒ Combo Box then Resize it to fit the Navbar

  • Add the following Properties:
    • Font ⇒ Segoe UI
    • Font Size ⇒ 20
    • Border ⇒ None
    • Allow multiple Selections ⇒ Off
    • Tooltip ⇒ Filter Sentiment

15.png

  • Add the following to Advanced:
    • Items ⇒ ["Negative", "Neutral", "Positive", "Mixed"]
    • InputTextPlaceholder ⇒ "Filter Sentiment"
    • NoSelectionText ⇒ "Filter Sentiment"
    • DefaultSelectedItems ⇒ ["Negative"]

16.png


6. Create the Reset Icon

Insert ⇒ Reset Icon then Resize it to fit the Navbar

  • Add the following Properties:
    • Color ⇒ White
    • Tooltip ⇒ Reset List

17.png

  • Add the following Action to Advanced that will be triggered when someone selects the icon:

 

Set(RefreshOutlook,true);

 

18.png


7. Create the Refresh Icon

Insert ⇒ Reload Icon then Resize it to fit the Navbar

  • Add the following Properties:
    • Color ⇒ White
    • Tooltip ⇒ Refresh List

19.png

 

  • Add the following Action to Advanced that will be triggered when someone selects the icon:

 

Set(RefreshOutlook,false);

 

20.png


8. Create the Emails Gallery 

Insert ⇒ Layout ⇒ Vertical Gallery then Resize it to fit the rest of the white area on the screen

  • Add the following Properties:
    • Data Source ⇒ Choose Office 365 Outlook

 

21.png

 

  • Edit the formula to get the unread emails from the feedback folder (Reference: here)

Note: Instead of "Feedback" you can Use "Inbox" If you have an email dedicated to receiving the feedback or If you want to use the inbox instead of another Folder.

 

Office365Outlook.GetEmails({folderPath: "Feedback", fetchOnlyUnread: true})

 

22.png

  • Layout ⇒ Title, subtitle, and body

23.png

  • Fields ⇒ Edit
    • Title ⇒ Subject
    • Subtitle ⇒ From
    • Body ⇒ BodyPreview

24.png


Now we are getting our emails from our Outlook and displaying the important information that we need!

Let's Resize and Change the Position of elements to be able to see the content better.

  • Template Size ⇒ 170

25.png


To be able to see all of the email content we need to set the overflow property to Scroll after choosing the body element.

26.png


Now let's enable the reset and refresh icons.

Why do we need them? The data we get from Outlook to PowerApps doesn't get updated automatically unless we request them again so, we force a request by removing the old list and requesting a new list of emails from Outlook using the two icons and a simple If statement. (Reference: here)


In the code below, we check the RefreshOutlook variable that we created earlier if it's true we empty our gallery using the Blank() method, if it's false we send a new request to Outlook to get the unread email.

 

If(
    RefreshOutlook,
    Blank(),
    Office365Outlook.GetEmails(
        {
            folderPath: "Feedback",
            fetchOnlyUnread: true
        }
    )
)

 

Choose the Vertical Gallery and Update the formula to enable the reset and refresh.

27.png


Now let's enable the Search feature. 

In the code below, we are searching the list of emails that we get from Outlook using the Search method we receive the text from the TextInput that we created and match it with the From, Subject, and BodyPreview fields from the emails. (Reference: here)

 

Search(
    If(
        RefreshOutlook,
        Blank(),
        Office365Outlook.GetEmails(
            {
                folderPath: "Feedback",
                fetchOnlyUnread: true
            }
        )
    ),
    TextInput1.Text,
    "Subject",
    "BodyPreview",
    "From"
)

 

Choose the Vertical Gallery and Update the formula to enable the search.

28.png


Finally, Let's use the sentiment analysis model.

Copy the email label and paste it inside the Email Gallery.

29.png


Reposition it inside our template and put it at the bottom.

In the code below, we use a function to check if the emails are not empty as this will give us an error if we sent an empty field to the AI builder, then we use an easy formula to send our BodyPreview to the Predict function then we access the returned JSON document key then the TopSentiment Key then we get the name and confidence to display them. (Reference: here)

 

If(
    IsBlank(ThisItem.From),
    "Loading",
    "Sentiment: " & ('Sentiment analysis'.Predict(ThisItem.BodyPreview).Document.TopSentiment).Name & ", Confidence: " & ('Sentiment analysis'.Predict(ThisItem.BodyPreview).Document.TopSentiment).Confidence * 100 & " % "
)

 

In the formula, add the code to use the sentiment analysis model.

30.png


Now let's enable the filtering by the sentiment from the combo box that we created earlier. (Reference: here)

In the code below, we are filtering the list of emails that we get from Outlook using the Filter method we receive the selected value from the ComboBox that we created and match it with the sentiment that the AI Builder returns for each value in the BodyPreview.

 

Filter(
    Search(
        If(
            RefreshOutlook,
            Blank(),
            Office365Outlook.GetEmails(
                {
                    folderPath: "Feedback",
                    fetchOnlyUnread: true
                }
            )
        ),
        TextInput1.Text,
        "Subject",
        "BodyPreview",
        "From"
    ),
    ('Sentiment analysis'.Predict(BodyPreview).Document.TopSentiment).Name = SentimentComboBox1.Selected.Value
)

 

Choose the Vertical Gallery and Update the formula to enable the Sentiment Filter.

31.png

 

Step 5: Create the Detailed View Screen

Now that you have learned about creating most of the elements in PowerApps try to do the rest of the application on your own.

If you need help you can find the full application in the repository below with steps on how to import it to your PowerApps Studio.

Create a new Blank Screen and name it Detail Screen.

32.png

 

Copy and Paste the Navbar Elements from the Previous Screen.

Go to github.com/John0Isaac/automate-business-email-management-aibuilder-powerappsClick on Code, and Copy the URL to Clone the repo locally.

 

Follow this guide to import and open the application to view the rest of the screens:

Click on Apps Inside your PowerApps Studio then Choose Import canvas app

37.png

 

Click on Upload and Choose the Zip file that you cloned from GitHub then Click on Open then Click on Import and Wait for it to load then Open the App.

38.png39.png

 

Then try to mimic the screen content or be creative and share your own creation with me in the comments here!!

The final product should look like this

33.png

 

Step 6: Create the Respond Screen

The same goes for this step as the previous one and the final product should look like this

34.png

 

Step 7: Test and Publish the Application

Now let's give our application a quick test!

application-demo.gif

 

It works!!

We can successfully:

  • See a list of our emails categorized based on the sentiment of the email body.
  • Search for a specific email.
  • View Email Details.
  • Dismiss emails we want to mark as read.
  • Respond to emails from power apps.

The last step is to save our changes and publish them by Clicking on Save Icon from the Navigation Menu and waiting until it finishes saving then Clicking on the Publish Icon from the same Menu.

35.png

36.png

 

Now you can find the application in your Microsoft 365 Online Apps section. office.com/apps 

 

You can share your application with anyone inside your Organization.

40.png

 

Thank you so much for following along...

Conclusion 

In conclusion, mastering inbox management is no longer an elusive dream but a tangible reality with the power of Low-Code to No-Code technology. Through this blog, we have shown you how to take control of your email overload by creating a dynamic Power Application that integrates seamlessly with Outlook and AI Builder.

By following our step-by-step guide, you now possess the ability to categorize and prioritize emails effortlessly, giving you the valuable time and peace of mind to focus on critical tasks. Whether you're a busy professional, a small business owner, or simply someone seeking a more organized digital life, these newfound skills will be a game-changer.


The beauty of Low-Code to No-Code solutions lies in their accessibility. You don't need extensive coding knowledge or a large IT team to implement these changes. Armed with a Microsoft 365 subscription and a Power Apps Developer Plan, you have the tools at your disposal to revolutionize your email management.


Now, it's time to put your knowledge into action and watch your productivity soar. Streamline your inbox, respond promptly to important emails, and gain an edge in your personal and professional endeavors.


We hope this blog has been a valuable resource on your journey towards more efficient email handling. Embrace the power of technology, unleash your productivity potential, and say goodbye to email overwhelm. Happy inbox organizing!

Live Demo

 

Found this useful? Share it with others and follow me to get updates on:

You can learn more at:

Feel free to share your comments and/or inquiries in the comment section below...
See you in future demos!
3 Comments
Co-Authors
Version history
Last update:
‎Sep 25 2023 05:36 AM
Updated by: