Build a Gift Declaration solution with the Power Platform
Published Dec 14 2022 01:19 AM 4,050 Views
Copper Contributor

Meet Mziwenhlanhla MngadiMeet Mziwenhlanhla Mngadi

Hi, I'm Mziwenhlanhla Mngadi, a university student currently pursuing a degree in Information and Communications Technology at the Durban University of Technology. As an aspiring low-code developer, I am ardent on using technology to simplify complex processes and enhance user experience. With keen interest in low-code development, I am confident in my ability to create intuitive and efficient solutions. As I continue my journey as a low-code developer, I hope to make a positive impact in the field.

 

As part of a program hosted by Greenlight Solutions in partnership with Durban University of Technology. and a Cloud Advocate at Microsoft, Someleze Diko to get young talent Microsoft Certified in Power Platform; 15 students – myself included - were each given a scenario where everyone was expected to develop a solution using the Microsoft Power Platform. The scenario assigned to me required I develop a Gift Declaration capture mechanism. Here is how it read.

 

Scenario

“Businesses use corporate gifting to establish ties with their business partners and to express appreciation for their business. In certain cases, it might be used negatively to carry favour in preferential treatment to gain an advantage over competitors. Develop a gift declaration capture mechanism that will ensure employees are abiding by the rules set out in a Gift policy.”

 

I will spare you the business rules/requirements in this blog as the focus for writing this is to highlight how I went about my solution. However, for those interested you can find the business rules here.

 

Solution

Before I set out on developing my solution, I had to identify what tools I needed, namely:

  • A database: to store relevant gift declaration information
  • Azure AD Group: to assign members of the gift committee and check app user membership
  • Office365: to retrieve user information such as their job title, manager etc.
  • A Power Automate Cloud Flow: to keep track of new declarations and notify the manager or Gift Committee, and requester where required
  • A PowerApp: to capture the gift declarations and view declarations made along their details
  • Adaptive Cards: to send declaration details via email to approvers, where they can approve or reject – providing reasoning and recommended action/s if rejected.
  • A Power BI Dashboard: to show an overview containing analytics for declarations submitted.

Mziwenhlanhla_Mngadi_0-1670955297658.png

Mziwenhlanhla_Mngadi_1-1670955329734.png

 

Entity Diagram

To meet the needs of the first requirement – a database – I opted for Microsoft Dataverse both for its reliability and security, and to keep within the theme of using Power Platform products.

 

I created four tables, a table to keep information about the declarations with a lookup to another table called “Gift” – with a column named “GiftDetails”. The declaration table had columns to track who the donor of the gift is, the recipient, the relationship between the two parties and an indication of whether the declaration was for a gift sent or received.

 

The gift table contained all information relating to the gift, such as gift description, gift monetary value, date the gift was received, reason for the gift. The approval status, status reasoning, recommended action and action completed – where applicable. Lastly, an “Item History” column to keep the GiftID for resubmitted items. This table had a lookup to another table called “Vendor Quotes”.

 

Vendor Quote table contained vendor quote file attachments for gifts being sent.

 

Lastly, I made a table called “External Party” which had Full Name and Company Name as columns. This table held information about external members – who are not inside the company – who can be clients or investors. These people are those who send gifts to employees or have gifts sent to them but are not inside the company.

 

Mziwenhlanhla_Mngadi_2-1670955479936.png

 

How the PowerApp works (Solution walkthrough)

With the table set up, I was able to start working on the Power Apps application.

 

When the user opens the app they land on a type of login screen, that has two buttons for department managers and Gift Committee members – “Sign-In as User” and “Sign-In as Admin”. For those that are not members of the Gift Committee only the “Sign-In as User” button is visible, while the “Sign-In as Admin” button is hidden. It determines this by checking the current user’s membership against an Azure AD Group for the Gift Committee. The buttons each have different functionalities and affect how the app looks - which will be covered as you read along.

Admin View

Mziwenhlanhla_Mngadi_3-1670955546711.png

 

User View

Mziwenhlanhla_Mngadi_4-1670955546716.png

 

Selecting any one of these buttons lands the user on the Home Screen of the app. Here a count for declarations Pending, Approved and Rejected is shown. Users who signed in as user, the counters will show the number of items created by that user only. Whereas users who signed in as admin will counters will reflect count of all declarations submitted throughout all the departments – if they are members of the gift committee – or for their department only if they are department managers. Note that those that sign in as admin cannot submit declarations, they must sign in as user to submit a declaration.

 

Admin View

Mziwenhlanhla_Mngadi_5-1670955804082.png

 

User View

Mziwenhlanhla_Mngadi_7-1670955915087.png

 

On the “Sign-In as user” experience, when you select “new declaration”, a notice is shown asking you to choose what type of declaration you want to make – whether you are making a declaration for a gift received or gift sent.

 

Mziwenhlanhla_Mngadi_8-1670955965679.png

 

Depending on the button you select you will be directed to the relevant form to fill in your details. By default, when you open the declaration form screen, the Department drop-down is automatically populated for you based on the information from Office365 about your account.

 

Mziwenhlanhla_Mngadi_9-1670956039829.png Mziwenhlanhla_Mngadi_10-1670956059520.png

 

If you miss any of the required fields, an alert dialog is shown asking you to fill in all required fields and the highlights those required fields with a red outline.

 

Mziwenhlanhla_Mngadi_11-1670956236277.png

 

When you submit the form, you meet with a dialog to confirm if you want to submit the declaration, upon selecting “yes”, the declaration is added to the relevant Dataverse tables – after, you are informed that the declaration was submitted successfully and are returned to the “Home Screen”. The same process is followed regardless of declaration type.

 

Mziwenhlanhla_Mngadi_12-1670956319527.png

 

Mziwenhlanhla_Mngadi_13-1670956331679.png

 

 

 

Business process configured on Power Automate

After submitting a declaration, a Power Automate Cloud flow if triggered in the back-end, notifying the department manager via email by use of adaptive cards containing important information of the new item added for approval – given the monetary value is below the threshold amount of R2000 (est. $144). However, the Gift Committee is notified if the declaration gift’s monetary value is above R2000 (est. $144) or the requester’s job title is the Chief Executive Officer/President or a Department Manager/Director – skipping the manager approval flow. The Office365 connector in Power Automate is used to get the job title of the requester.

 

Mziwenhlanhla_Mngadi_14-1670956393080.png

 

Moving on to the “view all declarations” button, here declarations are listed. The user can choose to filter out the declaration depending on the approval status of a declaration. Just as mentioned for the counters on the “Home Screen”, declarations also show items created by the user only if they signed in as user and it shows all items in the organization if the user signed in as admin.

 

Mziwenhlanhla_Mngadi_15-1670956474316.png

 

Mziwenhlanhla_Mngadi_16-1670956486246.png

 

 

By selecting an item, it will show all information about the item.

 

Mziwenhlanhla_Mngadi_17-1670956523565.png

 

If no items exist it will indicate that there are no items to show.

 

Mziwenhlanhla_Mngadi_18-1670956561913.png

 

Users can refresh listed declarations and sort declarations by the date the were submitted. However, for the admin experience, for pending declarations older items appear at the top and cannot be sorted – this is to ensure a FIFO(First-In-First-Out) system.

 

Admin View

Mziwenhlanhla_Mngadi_19-1670956639770.png

 

User View

Mziwenhlanhla_Mngadi_20-1670956688536.png

 

On "view all declarations" screen, items can have several icons attached next to them - each with a meaning behind them.

 

Mziwenhlanhla_Mngadi_21-1670956785082.png

 

That wraps up the “Sign-In as User” experience. Moving on to the “Sign-In as admin” experience.

The UX here, includes all that was mentioned above with some extra functionalities.

For one, the admin when viewing declaration details can approve or reject that declaration. If rejected, reasoning and recommended action are to be provided. After it shows that update was successful – refreshing the list of declarations after.

 

Mziwenhlanhla_Mngadi_22-1670956845765.png

 

Mziwenhlanhla_Mngadi_23-1670956879773.png

 

Mziwenhlanhla_Mngadi_24-1670956900859.png

 

Mziwenhlanhla_Mngadi_25-1670956926585.png

 

Performing any of these actions updates that record in the Dataverse and triggers cloud automate flows in the back-end to notify the person who submitted the declaration of the status change and/or status reasoning and recommended action - if the declaration is rejected.

 

Mziwenhlanhla_Mngadi_26-1670956971246.png

 

Data Analytics with Power BI

On to the last item of the solution, the “view analytics” button.

Selecting this button will navigate the user to a screen containing a Power BI tile – that tile contains a dashboard with various visuals and slicers to help filter the data. Users can interact with the visuals by select them, which applies filters to all visual on the dashboard. There is an option to filter the visuals by user, department, or the whole company and by declaration type.

 

Mziwenhlanhla_Mngadi_27-1670957027888.png

 

 

Summary

That about sums up the entirety of my solution.

 

I would not have come this far without the help of fellow boot-campers and our mentors for this program.

 

This project served as a learning experience for me as I experimented with services like Azure and tools like Adaptive Cards – which were all very new to me - and identifying methods to integrate the various Microsoft services. Solving a real-life problem taught me how to manage my time properly for a project like this and learn on the fly. To summarize, it was a valuable learning experience. It was a highly fulfilling accomplishment for me to reach the summit, which was the completion of this solution.

 

If you still stayed till this point, I thank you for reading till the very end – much love. I plan to include a live demo that you all can try out yourself and see the app functionality and possibly doing a “How to” where I break down how to make this solution from scratch – but that will have to wait until after the festive season – so bookmark this blog if you interested. Once again, thank you and enjoy the festive season.

Version history
Last update:
‎Dec 13 2022 02:00 PM
Updated by: