Jump to content

Build a Gift Declaration solution with the Power Platform


Recommended Posts

Guest Mziwenhlanhla_Mngadi
Posted

mediumvv2px400.jpg.ff06da20a07ba5c511914cd2d9fb3cf9.jpgMeet 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.

 

largevv2px999.png.fe402aa7220bec83da48132442ebe0ed.png

 

largevv2px999.png.5f741589278ffa08cf3d9b77cbf4fb10.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.

 

 

 

largevv2px999.png.d6cdb799f1386271f97b300072cd2d61.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

 

largevv2px999.png.2adcb21caa420cb8b1031454bc9f58b2.png

 

 

 

User View

 

mediumvv2px400.png.8a62d2617317ad609c725a7e28350b1f.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

 

largevv2px999.png.5dbb6abd6fb4ce259401b71cbd9d9981.png

 

 

 

User View

 

mediumvv2px400.png.088a6f229d01f599e228bcab90abc7d6.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.

 

 

 

mediumvv2px400.png.30ee588444bc62992160516e9c2afb1c.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.

 

 

 

[attachment=28413:name] [attachment=28414:name]

 

 

 

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.

 

 

 

mediumvv2px400.png.3525b75e7b7febe3bc9c3e953cd9ff3d.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.

 

 

 

[attachment=28416:name]

[attachment=28417:name]

 

 

 

 

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.

 

 

 

largevv2px999.png.783b91d7849669125f4b2ce59afdcddd.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.

 

 

 

[attachment=28419:name]

[attachment=28420:name]

 

 

 

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

 

 

 

mediumvv2px400.png.1a0aa40c65a9296a1b1b14a2ef0d4c30.png

 

 

 

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

 

 

 

mediumvv2px400.png.0bc6e119da4e06117f5d2bfe2b5fdf1a.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

 

largevv2px999.png.f4225654e998632d0ff43bcb53147fdc.png

 

 

 

User View

 

mediumvv2px400.png.17a9ec92d32974602d35acbf509b5c77.png

 

 

 

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

 

 

 

mediumvv2px400.png.b4f42bdc664c86a8a6d5f9c74288b7cd.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.

 

 

 

largevv2px999.png.8321a587bad333cc71df3af536355e36.png

 

 

 

largevv2px999.png.458d9da4142fe4f98c9a51b018ae152d.png

 

 

 

largevv2px999.png.e88c5ef2b5f93f742bcea1de2aff10fb.png

 

 

 

largevv2px999.png.2d0d51599abceaa448c2f593a5504202.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.

 

 

 

mediumvv2px400.png.8a7781b260ea721acc5e4084e6edce98.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.

 

 

 

largevv2px999.png.917e785d3c1496f26a7e03806c719236.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.

 

Continue reading...

mediumvv2px400.png.61d2b9706eabf1288cb557a72a2bc8d1.png

mediumvv2px400.png.5cc032565683067b0e632f81f58e4d39.png

mediumvv2px400.png.3f64b7d3a5bf517ca695bcd1ca189b7a.png

mediumvv2px400.png.8f5fa3af7f6ad24d83b587ab0ef1a584.png

mediumvv2px400.png.78d79433f6fde5853dec962f6544f44c.png

mediumvv2px400.png.5363ecc2968ac81e83aedce1cacfa927.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...