Tag: User Experience (UX)

  • Event access management Power App with external barcode scanning for passes

    Event access management Power App with external barcode scanning for passes

    I had a request from a customer who is running a 10-day event where attendees are permitted in certain areas. There will be in excess of 500 attendees who will all be issued passes that will indicate which area they are permitted in and the pass could include a QR code. Each of the entrances to the different areas will be staffed where passes will be checked. The different areas have capacity limits due to fire, Health & Safety and COVID19 reasons. The event is away from their normal infrastructure so they can’t rely on the normal access control systems we’ve become familiar with. Due to this, the customer felt a more automated approach to access management would be beneficial. They also run similar events throughout the year so any investment would be reusable. While I’d have preferred to break open the microcontroller toolbox and built some #IoT based pass readers but the customer wanted to use the Power Platform and their existing Office 365 investments.

    Power App event entry control kiosk. Prototype #1.
    Power App event entry control kiosk. Prototype #1.

    I started off with my usual design-first approach, sketching out some wireframes and mapping the customer’s requirements back to wireframes and building out personas, user journies and the solution architecture. Part of my wireframes led me to want to verify the barcode capabilities and reassure myself with the approach. I’ve built a number of solutions that have used both the old web barcode scanner and the more modern barcode scanner. While those solutions were a great success I never felt 100% satisfied with the scanner capabilities. I often found it hard to scan barcodes or would have to scan them multiple times increasing the overall time to complete a task. This is where my caution originated particularly creating a contact-free event access management solution to reliably handle such high footfall.

    Barcode scanning capability comparrison

    One of the advantages of the web barcode scanner control is that it worked on desktop and mobile and it is visible on the screen which made it very obvious to an end-user to scan something. The control is obsolete because of poor performance, and the mobile Barcode scanner control replaces this control.

    The mobile barcode scanner control is limited to Android and iOS and requires activation to enable the camera to start scanning.

    There are some tricks to activate scanning but this can make editing and use between desktop and mobile hard, particularly if you fall down the trap of activating scanning via the OnVisible action of a screen. At this point, you will lose the ability to edit the screen and instead get a warning about the control only working on Android and iOS.

    Error when using the Mobile Barcode Scanner in the browser or editor.

    Another option is to use a barcode scanner. This obviously isn’t a native control to Power Apps as it is effectively just a keyboard but there are lots of different styles of barcode scanners out there so these should be considered too.

    Hardware barcode scanner comparrision

    So after building out a proof of concept using the mobile barcode scanner and after numerous failed attempts to read a QR code, it was obvious this wasn’t going to be a solution I could rely on. So I decided to take a different approach. I knew barcode scanners are seen as a keyboard when connected to a device. So I switched out the mobile barcode scanner control with a simple text field. I was able to process any entered text using the OnChange action with a text input control. I knew this was going to be something I could try with a barcode reader so I decided to buy a couple of units to test with. I could have just used a cheapo barcode reader gun but I wanted something that would be similar to those used in the final access control entry point solution.

    One is similar to a checkout barcode reader. It’s a Lenvii E688 wired USB barcode scanner. It has a really helpful LED that is activated with nearby motion. It scans incredibly well and has an adjustable beep to acknowledge each scan. I tested this on my #Windows11 machine and on my iPad and iPhone with the help of one of those USB to appropriate device dongle adapter thingy-mac-things.

    The other, an Alacrity Bluetooth barcode scanner is a handheld Bluetooth and wired reader. It too has an LED and has the longest range of the two when reading bar codes. It also comes with a base that allows the reader to be docked for continuous scanning and powered where LED is on continuously scanning. The dock makes for a great pass barcode reader. Another benefit to this barcode reader is that it connects via Bluetooth and therefore allows for the barcode reader to be placed in a more accessible location without being prohibited by cable length. The barcode reader can also be removed from the dock and used in wireless handheld mode should that be needed.

    The event access management and entry conrol app

    I built a single app that could be used for the different tasks required to manage the attendees and passes for the event. The solution includes attendee registration and allocation of passes at the start of the event, attendee and pass management throughout the event, tools for Fire, Health & Safety marshalls such as capacity tracking and muster point registers and entry control pass scanning. I won’t go into detail on the full solution but will instead concentrate on the entry control features.

    Entry control

    The key part for the entry control task was that it should be fast, contact-free and act as a companion to support the person staffing the entrance. There is no fancy airlock doors or barrier system preventing someone from entering nor is there likely going to be any rule breakers storming in when not permitted. The entry control part of the app will speed up whether someone is permitted in that area and provides clear visual aids to the entrance staff.

    PowerApp Entry Point screen.
    Pass permitted to enter.
    Pass is not allowed to enter.

    Rather than place two devices at each entry point to handle people entering and exiting, I built the app to support it from a single entry point device. If you have scanned in successfully and entered, then scan again when leaving it will acknowledge you have left the area and remove you from the current capacity headcount for that area.

    The video demonstrates scanning pass to gain entry and then scanning again when leaving.

    The thing with the barcode reader approach is that it requires a text input to place the scanned barcode text into. In a kiosk-based solution, this isn’t great as end-users can “play” so I set about making hiding the control from the screen. First I made the control hidden but that prevented any input from the barcode reader. I then tried changing all the controls colours to match the background. While this made the text input mostly hidden I was still left with a flashing text cursor that I couldn’t hide. Finally, I set the width and height of the control to 0.

    Text Input is hidden by setting the width and height as 0.

    There is one problem though. You must use SetFocus(TextInput) to place the text cursor into the text box. This resulted in the ability to scan barcodes while not showing anything on the screen.

    Use SetFocus to allow scanned barcodes to be entered but the textbox to remain hidden.

    I hope this inspires you to think differently when approaching a project that could leverage barcode scanning in Power Apps but also inspires others to use barcode scanning as they create a really efficient solution for capturing data 💖. I’ll try to share some more pictures and updates as the solution progresses, particularly of the implemented access management solution and barcode readers.

    Bonus: I ordered a tablet holder which arrived just before I published this post so I thought I could show some early pictures of the reader and tablet together to test how this could work for the event. I think it looks great 🤩

    Barcode reader attached to stand with tablet.
    Barcode reader and tablet together on stand.
  • Smart dog training buttons

    Smart dog training buttons

    At first, it seemed a silly idea to create buttons our new puppy could press to tell us she wanted something. A few weeks later, after introducing these to our new 8-week old puppy Poppy, it seems the idea was far from silly. Poppy has started to learn that something happens when she presses these buttons. What that something is, depends on the button Poppy presses. She has already grasped that one of the three buttons I created allows her to let us know she wants to go out into the garden when the door is closed.

    Poppy pressing the button at 9 weeks old.

    Sure the idea was silly and just an excuse to have some fun. I started off by prototyping with a standard Zigbee button, playing with notifications and the possible languages for text-to-speech messages. I created an amusing character for Poppy’s text-to-speech messages. After trying different languages and adapting some of the spoken words to be more playful and fun, Poppy now had a French voice, and phrases such as “Humans” were read out like “Hoomans”. At this stage of testing, my partner hadn’t vetoed the idea, so I progressed to the design stage.

    Often at this stage, I feel like “Sid”, the antagonist who lived next door to “Woody and the rest of his friends”, and cannibalised toys in Toy Story, mostly because I end up trying to retrofit my crazy projects into something that looks half decent. When I fail, the projects end up in that “special box” we all have, but those that succeed live on another day. While this might make you giggle, there is a serious element to it – that user experience. In the maker space, it is not uncommon to see exposed circuits and wires, etc. For me, that is part of the fun. But it isn’t something I want my final projects to resemble, so I seek simple, intuitive, and good-looking ways to enclose my final projects. This is one of those examples.

    Why does my dog need these?

    She doesn’t. But with a connected smarted home, the things you can do are endless! I’ve grown up with dogs all my life but never had a puppy. With this comes the great responsibility to train her. Rather than bark or scratch the door, I wanted to teach her to use one of these buttons which could notify us that she needs something.

    I guess the solution is no different to panic buttons, butler buttons, and shops or cafes where it would be helpful to get a notification and even leverage text-to-speech when a button is pressed. The options in Home Assistant are truly endless and really provide opportunity to create accessible and inclusive solutions. For example, the solution could easily integrate with lights or digital locks but also loop until something else is done like a door is opened.

    As I made three of these buttons I currently have them set up to notify me when Poppy wants to go play in the garden, one near her lead for when she wants to go on a walk and the other with her food.

    How to make your own pet smart button

    To make these buttons I brought a set of radio-frequency (RF) buttons. The pack included three nice-looking buttons each with a paw embossed on them and a receiver chime plug. I brought these hoping I could strip them and replace them with my own Zigbee button. Fortunately, the buttons were held together with a few small screws and came apart really easily. Inside was a small RF circuit which was easily removed again by removing a few small screws.

    RF-button remove from its case.
    RF-button removed from its case.

    For the “smart” part, the button, I brought a Sonoff SNZB-01 Zigbee button which I removed from the Sonoff case. This was slightly trickier and needed levering out. For this, I used a plastic ply tool and with a little wriggling was able to remove the circuit from the case. As the case is used to hold the battery in place I used some Gorilla tape to secure the battery to the circuit.

    Sonoff SNZB-01 Zigbee Button removed from its case.
    Sonoff SNZB-01 Zigbee Button removed from its case.

    Then comes the cannibalisation part, combining the new button with the case from the old button. The Sonoff button needs to be positioned in the RF-button case ensuring the button centre is placed in the centre of the case. This is so that when the case is pressed the button can also be pressed. I folded some tape over a few times to raise the Sonoff button slightly. Not over-tightening the screws on the case also provided more play for the button to be pressed.

    Sonoff SNZB-01 Zigbee button inside a case intended to be used by our dog Poppy.
    Sonoff SNZB-01 Zigbee button inside a case intended to be used by our dog Poppy.

    Home Assistant integration

    Home Assistant provides such great flexibility and extensibility. For this project, I created several helpers, which I use to apply the configuration to each button and to integrate each button press with a mobile notification and text-to-speech message which is played out over my Sonos speakers. My Home Assistant configuration is managed through YAML, but the same can be achieved in the UI.

    For each button I created the following helpers and automation:

    Trigger-based template sensor

    The Zigbee button fires events when pressed. I’m using a trigger-based template binary sensor to cause the state of the binary sensor to change when the button is pressed. This provides me with a sensor that I can show in the UI and also capture insights from.

    Note: I have a split configuration where my entities and integrations are defined in folders and YAML files. I wasn’t able to get this template sensor to work like other templates and had to store this in my main configuration.

    Messages

    Both the text-to-speech announcement and the mobile notification message are stored in the input_text helpers.

    Volume and Delay

    To control the volume of the text-to-speech message and the time between the next time the button can be used I created the following input_number helpers.

    Automation

    The following automation calls a text-to-speech script that snapshot my Sonos speakers, groups the speaker’s together, sets the volume and reads then reads out the message before reverting back.

    Lovelace

    Poppy has her own pretty cool dashboard where we track her health, food, and diet as well as her location from her LTE GPS collar. The buttons I made reside in their own Lovelace view in her dashboard.

    As with most, if not all my automation, I leverage helpers to manage the configuration used in the automation as described above for this project. I then expose the helpers in Lovelace which makes it easier to manage and change their values. For example, the volume and text-to-speech announcement and mobile notification are all changeable in the UI via this approach for each of the three buttons I made.

    Using the Fold Entity Row Card I often collapse helpers out of the way. Alongside these helpers, I’ve used the Mini Graph Card to provide insights into when each button has been interacted with over the last day. For those interested in the Yaml for the Lovelace cards, I have shared it here.

    Example Lovelace card for a single button, with helpers and insights in a vertical stack card.
    All three smart pet buttons in Poppy’s Lovelace dashboard.

    I hope this is helpful and other pet owners can see the benefit of these training buttons. If anyone needs me I’ll be training and playing with Poppy 🙌🐶🐾 and now doubt tinkering with some other fun project!

  • Replicate SharePoint Hub site navigation to other Hub sites

    Replicate SharePoint Hub site navigation to other Hub sites

    I have been working with a large government department where Microsoft Services helped them transform their intranet to SharePoint Online leveraging all the modern capabilities available as well as rethinking what an intranet was. This work included envisioning to fully exploit all of Office 365 and a crucial Information Architecture (IA) design which also mapped their existing, complex and poorly performing hierarchy of subsites to several new hub sites and a completely flattened site structure. I hope to write more about this work soon.

    Primary intranet site navigation provider

    To create a consistent user experience, the look and feel for several hub sites was replicated, creating the feel of a single intranet. The hub site navigation also needed to be replicated, and that is wherein the challenge lay. The navigation cannot be easily copied from one site to another, let alone between hub sites, and thus this solution was born.

    We decided to create a dedicated hub site that only the intranet team can access. Within this hub site, we were then able to create the intended intranet navigation and get the headings, order and links just right without troubling anyone. Once we were happy with the navigation and testing successfully passed, the idea was that we would be able to replicate the hub site navigation to all our other hub sites. More importantly, the process could be easily repeated, keeping the intranet navigation updated across many hub sites. The task could also be automated but we opted to leave it as a manually initiated task.

    Script to replication hub site navigation to other sites

    The solution to the problem is a PowerShell script made up of two functions. One function that gets the navigation from the hub site acting as the master or primary navigation provider (supplied from a parameter). The other function replicates the navigation to other hub sites. The Get-SPOHubSiteNavigation function exports the hub site navigation from the site provided to a CSV file. The CSV file is then used by the Copy-SPOHubSiteNavigation function to replicate the navigation links to other sites. The process could be hijacked somewhat to add hub site navigation from a CSV file rather than reading it from an existing hub site. We found it was easier to get a feel for the navigation in a real SharePoint site rather than work with the information in a spreadsheet.

    Screen recording of the Copy-SPOHubSiteNavigation replicating navigation between two hub sites.
    Screen recording of the Copy-SPOHubSiteNavigation replicating navigation between two hub sites.

    You can also disable the export process by setting the -Export parameter to -Export:$false. This switch makes the Get-SPOHubSiteNavigation quite useful for displaying the hub site navigation in an accessible collection. This collection can be used with pipe functions, to filter or sort the collection, for example. This collection is also much easier to work with than using the Get-PnpNavigationNode -Location TopNavigatioBar -Tree cmdlet and parameters to show the full navigation structure.

    Hub site navigation collection displayed in a table.
    Hub site navigation collection displayed in a table.

    Observations

    As with many of my posts, I like to share any observations I have made during the work.

    • The cached Hub navigation appears to refresh every 30 minutes if left unchanged. You can force the cache to refresh by editing the links and then clicking cancel.
    • A JSON file gets saved to the /_catalogs/hubsite library which could be related to the cached navigation. It has a GUID based name e.g. 20d31c78-8a8c-499a-b953-ecc673344cef.json and appears to get modified by the System Account when changes to the hub site navigation are saved.
    • The cached JSON file looks like this:
    • This JSON file, in theory, could be read from a source site and the navigation element copied and injected into the JSON on a target site through manipulation of the JSON payload and the /_API/navigation/SaveMenuState API.
    • When trying to add a new navigation node using the Add-PnpNavigationNode cmdlet. If the parent node was invalid I got the following error. This wasn’t because the URL linked to a file or folder that didn’t exist as the error below suggests. Dave Garrad kindly calls out the fix for thisThe fix is to add -External to the Add-PnPNavigationNode cmdlet to tell PowerShell that the link is not in the same site collection.
    Add-PnPNavigationNode error
    Add-PnPNavigationNode : error when no resource or file is available from the Url supplied.
    • The script could benefit additional error handling, particularly to ensure the target site(s) provided are registered as hub sites.
    • Bonus tip! If you find you have lost changes to the navigation, this same JSON file is part of a library where version history is enabled. This file appears in hub sites and sites associated with a hub site. The version history might help you recover from any loss, but you won’t be able to restore it as the library appears to be read-only.
    Version history available for JSON file which I suspect ins the cached hub site navigation
    Version history available for JSON file which I suspect ins the cached hub site navigation

    I hope you find this post useful. As always #SharingIsCaring

  • Switch between modern SharePoint homepages using PnP PowerShell

    Switch between modern SharePoint homepages using PnP PowerShell

    This featured in Episode 44 of the SharePoint Dev Weekly podcast.

    I’ve been working on a modern intranet project amongst over projects for the last 12-months. This has been more about the transformation of content and business processes, rethinking information architecture and reimagining a modern intranet than it has been about custom development.

    I’ve been working on a modern intranet project amongst over projects for the last 12-months. This has been more about the transformation of content and business processes, rethinking information architecture and reimagining a modern intranet than it has been about custom development.

    We’ve recently been testing variations in the design of a homepage with different audiences. This side-by-side comparison has allowed end-user feedback, performance and accessibility testing. The same approach has also been useful for previewing and testing the capabilities of new features (like the new Yammer web part). The challenge comes when you need to promote or switch over one of these variations as the new site homepage. The homepage is the page users are directed to when first navigating to a site or clicking on the site logo. It is like as important as the index.html or default.aspx page existence to a website. Note that these variations of the homepage permit testing of content and not site configuration. To test navigation, theme or similar we have separate sites and environments for this purpose.

    To solve the problem switching the homepage from an existing page whilst preserving the home.aspx page name I’ve leveraged the SharePoint Pnp cmdlets to create a script that will rename or remove the current homepage (and can remove it through a toggle) and then rename an existing page to make it the new homepage.

    Set-SPNewHomePage script demonstration
    Demonstration of the Set-SPNewHomePage script in action.

    Use my PnP PowerShell script to replace the home.aspx page

    Alternative methods

    Change the default homepage through SharePoint

    Site Owners can use the out-of-the-box make homepage action to make any page the default homepage or welcome page. This is available from the toolbar in the site pages library. But this keeps the page name and means the default page is /sitepages/randompagename.aspx instead of the standard /sitepages/home.aspx that all sites have. From my perspective this is not great. Certainly, intranet-like sites should follow some basic content management principles. Call in a touch on the OCD side but consistently having a standard homepage is one of these for me.

    Screenshot of setting a new homepage in the site pages library.
    Screenshot of setting a new homepage in the site pages library.

    Change the welcome page site property through Site Settings or PowerShell

    Previously you could use the classic settings page (typically exposed by the publishing feature) or by browsing to /_layouts/15/AreaWelcomePage.aspx to make changes to the welcome page. This method no longer works and throws an error.

    As with the make homepage action describe earlier this changes the default homepage to the use the page name you have provided and means the site won’t be available if users have bookmarked the site with the page name (/sitepages/home.aspx) in the URL.

    Screenshot of the welcome page site settings page.
    Screenshot of the welcome page site settings page.

    What is my point? To this day can I still memory recall core settings pages. With these, you can quickly review or makes changes to settings pages rather than using the UI to navigate to them. This includes those that may no longer be exposed in the UI. Whilst my memory serves me well I don’t recommend this approach as these pages and settings are gradually being replaced with alternatives or removed by the SharePoint and Office 365 engineering team for a reason.

    Instead, you can also use Pnp PowerShell to change the site welcome page property. I’ve provided an example script below.

    As simple as my script is, it is the approach worth learning the most. I hope you find this article useful and as with all Pnp development effort. Sharing is caring!

  • The Sign in as Different User option is missing in SharePoint 2013

    The Sign in as Different User option is missing in SharePoint 2013

    I’ve been exploring SharePoint 2013 in recent days and noticed that the ‘Sign in as Different User’ option or action from the welcome control (user menu) seems to have been removed or forgotten from the user interface in this build.

    Sign in as Different User in SharePoint 2010
    Sign in as Different User in SharePoint 2010
    No sign in as different user missing in SharePoint 2013
    No sign in as different user missing in SharePoint 2013

    For someone who works with SharePoint as I do, any kind of administration, developing or testing that requires you to sign in as another you will now become convoluted from the previous version and is somewhat frustrating and annoying. Others such as Nick Grattan have discussed this issue and possible workarounds.

    Of all the workarounds currently available such as browsing to the closeConnection page directly, modifying the welcome control and adding the control back (I do not recommend this approach), creating a javascript bookmark, embedding jQuery into the master page to insert the option back in the menu and lastly launching the browser with the RunAs option my preference will remain to browse directly to the closeConnection page:

    /_layouts/closeConnection.aspx?loginasanotheruser=true

    Or alternatively, use the javascript bookmark Cory Peters has kindly created:

    javascript:window.location.href=”http://”+window.location.host+”/_layouts/closeConnection.aspx?loginasanotheruser=true”;

    It will be interesting to see what others do and as to whether or not the option gets added back by Microsoft in a future update.