Creating a Finance App with Model-Driven Apps from Scratch – Part I

In this series, I’ll explain how to create a low-code / no-code finance app using Model-Driven Apps in the Power Platform. My goal is to keep it accessible even for people without a coding background by leveraging the no-code tools provided by the Power Platform. However, I might include some code here and there to elevate the app to the next level.

I’ve decided to create an app for managing asset portfolios because I’m interested in finance and sounds fun getting paid for gambling with other people’s money. While I have a general idea of how the app should look, I want to stay flexible and let the concept evolve as I build it.

The Solution

I always start projects by creating a new solution. This step is important because an app consists of multiple objects, and we might be working on multiple projects simultaneously. Creating a solution helps keep everything organized and makes it easy to export to another environment.

Tables

Inside our solution, we select New > Table > Tables.

Then, we select how to create the tables. In my case, I choose to start from blank because it gives me more control than Copilot, and the AI doesn’t always get it right.

We then create the main table, ‘Portfolios’. Using the ‘New Column’ option, we add the columns we want, although we can remove or add more later if needed.

The primary column is the one we’ll see in lookups, and it should contain a unique value. We can identify the primary column and also change the table’s singular and plural names in ‘Properties’.

We’ll create a second table for the movements. This table will also have an ID as the primary column, along with the following fields: movement type (Choice), amount (Currency), quantity (Decimal), and date/time (Date Time).

For the movement type, we have the following options:

Buy, Sell, Adjustment, Dividend, Expense, Cash Deposit (Not in the picture), Cash Withdraw (Not in the picture)

Now, let’s link the two tables. The relationship will be 1-to-many (1:*), where one portfolio record will have multiple movements.

There appears to be a bug, as it shows *|1 instead of 1|*. However, I checked that the relationship was created correctly. If not, we can always fix it later by adding the lookup “Portfolio” in the “Movements” table.

I’m going to save the tables, although our app will have more tables in the future. For now, let’s just make sure the tables we’ve created are included in the solution.

Model Driven App

Now, we can create the App:

And let’s add the tables we’ve created to our MDA:

We can adjust the navigation and create New Groups (navigation sections):

And we can view our app by pressing the play button:

Forms

Right now, our main Portfolio form looks like:

We can edit it under the table and Forms section in our solution.

At the moment, we’re just going to edit the main form.

First, I’m going to change the order of the fields:

Then, I’ll add the Movements view as a grid, showing only those related to the current Portfolio record.

And now, I can save and publish, then move on to edit the next form, the Movements form.

In the Movements form, I’ll create a two-column grid and make the ID field non-editable, as we’ll set it to an automatic number sequence.

Finally, before publishing, I’m going to add the currency selector, as assets may be priced in different currencies.

Number sequence

We can easily create an automatic number sequence for the Id field in the Movements table. To do this, simply select the field in the Columns section of the table and change its data type to Autonumber. Additionally, we can customize the sequence by adding a prefix, setting the minimum number of digits, and specifying a seed value (the starting number).

Now, when creating a record and saving it, the ID will be autogenerated.

Views

When we click on a menu of our app, the first thing we see is a view. also, the grid we created in our Portfolio form is also a view.

We can create additional views or edit the default ones. Views can be edited within the Views section of each table.

First, I’m going to turn off the Inactive Movements view. The reason is that Movements is a transactional table, so it doesn’t make sense to hide records.

Next, edit the Active Movements view by renaming it to simply Movements. Sort it by the Date field in descending order (using the arrow in the “Sort By” section) instead of the default Created Date/Time. Allow inactive records to be displayed, deleting the filters in Filter by, and add, remove, or reorder columns as needed.

Next, we might not want the Portfolio column to appear in the form’s grid, as it’s redundant. To address this, delete the column and use Save As to create a copy of the grid. Then, edit the Portfolios form again and update the view.

We can also edit the Portfolio views to our liking. In this case, it makes sense to maintain one view for active records and another for inactive records.

Extra: Icons

This nice detail will make our app look much cooler: 🎨

I found a website that offers Microsoft’s Fabric UI icons, ready for download.

In the next post, we’re going to create the Assets table (stocks, bonds, currency, etc.), so each movement can reference an asset. We’ll also explore a way to automatically update the value of each asset.

Part 2 ->


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *