PowerApps – Notify

The Notify function displays a banner message to the user at the top of the screen. It works in a similar fashion to a Visual Basic User Information Message or Warning.

It can be used to instruct the User to do something.

Syntax

Simply: Notify( “Your Message Here“)

Notify(“Message”,[messagetype optional] ), Message Types: Error, Warning, Success and the default Information

Real Life – Example

I have an HGV Transport App used by our truck driver team. When a Driver clicks to start a delivery the record in SharePoint is updated to show “In Progress” , together with Location and Start Time. When it is completed the Driver clicks again and the status is changed to “Delivered” with End Time and Location. How it works:

The Driver App shows 2 Galleries:
Gallery 1: Loads “Awaiting Delivery” and Gallery 2: Loads “In Progress”

OnSelect an Item in Gallery 1:
If(CountRows(Gallery2.Allitems) >0, Notify(“You must Complete your Current Delivery first” ,Error), then else action)

Generate Barcodes & QR Codes in a Power App

By the end of this tutorial, you’ll be able to dynamically generate QR Codes and Barcodes in a Power App with your own custom content.

The following are PowerApps Gallery examples:
Note: Replace italicised text with your own.

Simply insert an Image Control and change the Image source from SampleImage to:

For Code 128 Barcodes in Gallery items use:
“http://bwipjs-api.metafloor.com/?bcid=code128&text=” & ThisItem.SiteID &”.png” Or

“http://bwipjs-api.metafloor.com/?bcid=code128&text=” & ThisItem.ItemNumber &”.png”

For QR Codes in Gallery items use:
“https://api.qrserver.com/v1/create-qr-code/?size=10×10&data=” & ThisItem.ItemNumber &”

For Dropdown Controls:
Again insert an Image Control and set the Image property to:
For Code 128 use
 “http://bwipjs-api.metafloor.com/?bcid=code128&text=” & SiteDD.Selected.ID &”.png”
Or
For a QR Code use
“https://api.qrserver.com/v1/create-qr-code/?size=10×10&data=” &SiteDD.Selected.ID

Near Miss Accident Reports – Power Apps – Part 1

We demonstrate in this post how you can build your own Near Miss Accident Reporting App using Power Apps, SharePoint.

The Part 2 Post will demonstrate how using Power Automate your Health & Safety Administrator will be aware of each report immediately it is made.

Fact: In the workplace when near misses occur, then accidents are sure to follow.

Research has shown that for every 90 near misses an accident will occur. And while the exact numbers may vary, near-misses are a warning sign that something is going wrong.

Reporting of near misses reduces accidents and improves safety. They help you to find out what went wrong, fix problems, and learn lessons. Let Power Apps help.

I will show you how, using Power Platform and SharePoint, you can build your own in-house Near Miss Reporting App.

For Near Miss Reporting with Power Apps, you will need:

  • An Office 365 Subscription
  • A SharePoint List
  • A Canvas Power App
  • A Power Automate Workflow
Step 1 – First, we need to create the SharePoint List
  • In a New List named NearMissReports create the following columns:
    • Location: (Single line of text)
    • Description: (Multiple lines of text)
    • Date: (Short date)
    • Allow Attachments: (This should be enabled by default)
Step 2 – Create the Canvas Power App
  • From within Power Apps
    • Click > Create, Choose > Canvas app from blank
    • Name the App Near Miss Reporting
    • Choose Phone Format
    • Click Create
Step 3 – Connect the SharePoint list to your new App
  • Data > Add Data > Connectors > SharePoint
  • Navigate to your SharePoint List
Step 4 – Insert a Form into Your App
  • Insert > Form > Edit Type
  • Link your form to the Data Source
Step 5 – Add a Button

Add a button at the foot of the screen.
Select the OnSelect action of the Button

Type: SubmitForm(FormName)

 

Your Power App Screen should look something like the image on the right.

Some Changes

I have changed the default date to Now() as opposed to the default Hint Text.
To do that you need to unlock the Date Picker Control and replace the Default of “Parent.Default” with Now( ) or Today( ).
Next change the Button text Property to “Submit” or “Save”
Unlock the Description control and enlarge the Text input box. You can also change the title of the Control to something more user friendly like ” Describe what happened”.
Similarly you can change the “Location” Control. if you have a limited set of locations you could change the Text Input of the control to a dropdown list of choices. The format of the items property of the dropdown would be
[“Area 1″,”Area 2″,”Area3”]

 

PowerApps beating the 2000 Limit

Our Current Inventory System has over 2000 items stored in a SharePoint list. Problems of course started to arise with the search functionality as soon as we went over the 2000 limit.

Two Solutions – Solution 1 – Split and Merge into a New Collection

The Inventory is divided into several Categories of Item, the largest being Metals with over 500 Items. Removing this Category to a separate SharePoint list would solve the problem but that would create difficulties with Search.

OnStart (Create 2 Collections)

ClearCollect(OurStock,ShowColumns(CurrentInventory,”ID”,”Item_x0020_Number”,”Item_x0020_Description”,”Category”, “SubCat”));

ClearCollect(OurMetal,ShowColumns(Metaals,”ID”,”Item_x0020_Number”,”Item_x0020_Description”,”Category”, “SubCat”));

Merge the 2 Collections into a Third Collection

ClearCollect(FullStock, OurStock, OurMetal)

Solution 2 – Merge into a New Collection

OnStart (Create 2 Collections) one in Ascending order the other in Descending order.

Concurrent(

ClearCollect( colInvent1, Sort(CurrentInventory, ID, Ascending) ),

ClearCollect( colInvent2, Sort( CurrentInventory , ID, Descending) ) );

Remove the Duplicates

ClearCollect( ( colInvent , ( colInvent1 , Filter( ( colInvent2 , Not(ID in ( colInvent1 .ID)) );

Containers in PowerApps

Once you get the hang of using Containers the design and layout of your Apps becomes much simpler, neater and more Professional.

When controls such as Labels, Buttons Dropdowns are inserted into a Container they are positioned automatically. This means no more trying to line-up controls manually or inserting X and Y co-ordinates. All your controls will be aligned either Vertically or Horizontally giving you a Professional finish to your App.

The 3 Types of Container

Examples of Horizontal and Vertical Containers

Filtering Basics

Filter
Filter(SharePoint List or Table,­con­dit­ion­1[,­con­dit­ion2] )
Example: Filter(MyDataSource,Title = MyTerm)
Result: A table with all records where Title = MyTerm

Sort and Filter
Sort(Filter(SharePoint List or Table,­con­dit­ion­1[,­con­dit­ion2] ) , SortColumn)
Example: Sort(Filter( MyDataSource,Title = MyTerm),Age)
Result: A table with all records where Title = MyTerm sorted by Ascending Age.

Sort with Distinct Filter
Distinct(Sort(SharePoint List or Table,­ColumnName ) , ColumnName )
Example: Distinct(Sort( MyBookList, colAuthor),colAuthor))
Result: A table with one occurrence of each Author’s Name sorted by Author’s Name.

Power Apps and the Power Platform

Exit mobile version