Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Power Apps Cookbook, 2e

You're reading from   Microsoft Power Apps Cookbook, 2e Apply low-code recipes to solve everyday business challenges and become a Power Apps pro

Arrow left icon
Product type Paperback
Published in Aug 2022
Publisher Packt
ISBN-13 9781803238029
Length 414 pages
Edition 2nd Edition
Arrow right icon
Author (1):
Arrow left icon
Eickhel Mendoza Eickhel Mendoza
Author Profile Icon Eickhel Mendoza
Eickhel Mendoza
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Building Pixel-Perfect Solutions with Canvas Apps 2. Building from Data with Model-Driven Apps FREE CHAPTER 3. Choosing the Right Data Source for Your Applications 4. Automating Processes with Power Automate 5. Extending the Platform 6. Improving User Experience 7. Power Apps Everywhere 8. Empowering Your Applications with No Code Artificial Intelligence 9. Discovering the Power Platform Admin Center 10. Tips, Tricks, and Troubleshooting 11. Advanced Techniques with Power Apps Component Framework 12. Reaching Beyond the Organization with Power Pages 13. Other Books You May Enjoy
14. Index

Embedding an expense tracking list with SharePoint list Power Apps

Earlier, in the Creating an incident tracking solution – setting up the data source recipe, we configured our SharePoint data source. We will use the same steps to create our data source for this recipe.

Getting ready

Planning for this data source requires the creation of related columns to track expenses. As a template, we could use the following options:

  • Projects: This list will hold project information, which will help us link the fees and the customer who owns the project. We will use the customer list created in the previous recipe for this connection.
  • Expenses: This list will save the information related to the expense.

How to do it…

  1. Go to the desired SharePoint site and create the Projects list by selecting + New and then List:
Graphical user interface, text, application  Description automatically generated

Figure 1.7: List creation process

  1. Set the name to Projects and once the list gets created, click on the gear icon at the top right and select List settings. Add the following columns by clicking on the Create column link inside the Columns section:

    Column name

    Column data type

    Required

    Name

    Single line of text

    Yes

    Client

    Lookup

    Yes

    Table 1.3: Projects list columns

    Click on the gear icon at the top right and then Site contents to create the expenses list. From there, select + New | List from the toolbar. Set the name to Expenses and use the following columns:

    Column name

    Column data type

    Required

    Expense

    Single line of text

    Yes

    Date

    Date

    Yes

    Category

    Choice

    Yes

    Project Name

    Lookup

    No

    Amount

    Currency

    Yes

    Comments

    Multiple lines of text

    No

    Table 1.4: Expenses list columns

  1. For the Category column, use these choices as an example: Travel, Transport, Supplies, and Meals. Add as much example data to the list as you like.
  2. Click on the gear icon in the top-right corner, select Site contents, and select the Expenses list.
  3. On the list’s toolbar, select Integrate | Power Apps | Customize forms. This action will automatically create an app based on the list structure. This time, it will build an app with only one form and one particular control called SharePointIntegration:
Graphical user interface, application  Description automatically generated

Figure 1.8: SharePointIntegration control inside Power Apps

  1. Make relevant changes to your app, such as increasing the comments’ height, resizing the attachments’ control, and making style changes.
  2. Save and publish your app.

How it works…

As you can see, the new application differs from the one created earlier because this one gets embedded inside the SharePoint list. It replaces the regular list’s data entry mechanism by displaying the Power App whenever you want to view, edit, or add new records:

Graphical user interface, text, application  Description automatically generated

Figure 1.9: SharePoint list Power App

This integration gets done by the SharePointIntegration control mentioned earlier. It acts as a bridge between SharePoint and Power Apps to catch the data events (view, create, and edit) while also allowing us to handle the save and cancel events:

Graphical user interface  Description automatically generated

Figure 1.10: SharePointIntegration actions

These actions are regular code blocks that get triggered depending on each event.

Embedding Power Apps inside a SharePoint list gives us the flexibility to control how the data gets registered, improve the data validation, and even allow connections to other services besides SharePoint, just to name a few examples.

There’s more…

Think outside the box when building embedded apps. They are not only there to improve data entry forms. You can create full-fledged solutions inside your lists. Please refer to the following example showcased on the Power Apps blog: https://powerapps.microsoft.com/en-us/blog/island-council-of-tenerife-organizes-community-events-using-the-power-platform

Embedding Power Apps in SharePoint lists is just the tip of the iceberg. There are many more scenarios where you can enrich your current platforms by integrating Power Apps: Microsoft Teams and SharePoint pages, to name a couple. Want to know more? Please refer to Chapter 7, Power Apps Everywhere, to view more recipes that extend the use of Power Apps.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime