Build an Asset Management App - Controls, Logic and Formulas
The user interface of your Asset Management App is only as good as the logic and functions powering it. This part focuses on implementing the core features of your app—barcode scanning, map navigation, and camera controls—while ensuring seamless integration with the data source and user interface. By combining these elements, you create a seamless and efficient workflow for technicians and administrators.
Part 3: Implementing Logic and Functions in Your Asset Management App
1. Barcode Scanning for Asset Identification
The Barcode Scanner Control in Power Apps simplifies the process of identifying assets without manual data entry. This feature ensures that technicians can quickly confirm the asset they are working on.
How to Implement:
Add Barcode Scanner Control:
Drag and drop the Barcode Scanner Control onto the Maintenance Logging Screen.
Place it in Step 1 of the workflow for scanning the asset.
Logic for Verification:
The barcode scanner returns an array, so use the
Last
orFirst
function to fetch the scanned value: Last(BarcodeScanner.Barcodes).Value
Compare the scanned barcode with the selected asset:
If(Last(BarcodeScanner.Barcodes).Value = SelectedAsset.AssetNo,
Notify("Asset matched!", NotificationType.Success),
Notify("Asset scanned does not match the selected asset.", NotificationType.Error))
In this formula:
SelectedAsset.AssetNo
is the barcode value of the asset selected on the Dashboard screen.SelectedAsset
is set when the user navigates to the Asset Details screen using: Set(SelectedAsset, ThisItem)
2. Map Navigation for Asset Location
The embedded map control allows technicians to locate assets easily, saving time and effort in field operations.
How to Implement:
Add Map Control:
Add the Map Control to the Technician Dashboard and Asset Details screens.
Bind asset locations to pins on the map: Location(Items) = Filter( Assets, Technician.’Technician Name’ = User().FullName). This filters the assets that have been assigned to the logged in user. User() returns a record of the logged in user with full name, email, and image.
Show the Current Location:
Display the technician’s current location dynamically:
Show current location : true
Current location latitude: Location.Latitude
Current location longitude: Location.Longitude
3. Logging Maintenance Activities
Technicians can log detailed maintenance records, including notes, updated statuses, and images of the asset condition.
How to Implement:
Step-by-Step Workflow:
Update Status:
Add a dropdown control for selecting asset status (e.g., "Repaired," "Requires Follow-Up").
Populate it dynamically: Choices(Status (Assets))
Add Notes:
Include a multiline text input for detailed observations: NotesInput.Text or NotesInput.Value
Add Image:
Use the Camera Control to capture images.
Save Button Logic:
Add a button to submit the maintenance record:
Patch(MaintenanceRecords, Defaults(MaintenanceRecords), {Asset: SelectedAsset, Notes: NotesInput.Text, Photo: CameraControl.Photo});
Patch(Assets,SelectedAsset,{Status: StatusDropdown.Selected.Value})
Bringing It All Together
With the features fully implemented, your app will offer:
Seamless Asset Identification: Barcode scanning ensures quick and error-free asset matching.
Effortless Navigation: Map controls guide technicians to asset locations and enable direct asset selection.
Streamlined Maintenance Logging: Step-by-step workflows allow technicians to update asset statuses, log notes, and upload images with ease.
Conclusion
By implementing barcode scanning, map navigation, and maintenance logging, you’ve transformed your Asset Management App into a powerful tool for technicians and administrators. This part has focused on logic and functions that integrate seamlessly with the user interface and data source, providing a robust and user-friendly solution.
Your app is now ready to streamline asset management operations and enhance productivity across your organization.