Forum Discussion

MatthewG_QCHI's avatar
MatthewG_QCHI
Copper Contributor
Feb 28, 2025

Daily Security Passphrase

We operate remote store locations around the US. When a corporate employee calls a store location on the phone we need a way for the store employee to be able to validate that the caller is legitimate and from corporate. We want to create a widget or app on our internal SharePoint operations page that will automatically generate a random security passphrase or code each day. When the caller calls the store, the store employee can look on the SharePoint page and see the passphrase. They can them ask the corporate caller what the daily passphrase is. The Corporate caller can access the same internal page and recite the daily code to the store staff member. If they match, the call is legit.

How do I create this widget? Is there something I can use out-of-the-box? 

I am non-technical so I need help understanding how to build this type of solution.

  • Rob_Elliott's avatar
    Rob_Elliott
    Bronze Contributor

    This isn't possible out-of-the-box but is very do-able with a list in SharePoint, a Power Automate flow and a list web part on your SharePoint page. I have had the following run every day for about 4 years to get a random country from a list of all 250 countries contained in a SharePoint list.

    The list for this is called Countries and is as follows:

     

    The flow is as follows. It runs once a day at 0700 and gets the item that is currently marked as Yes in the Current column:

     

    We then change that item back to No:

     

    We then get all the items from the list and in a Compose action add the following expression to get a random item from the first item in the list, 0, to however many items there are in the list:

    body('Get_items')?['value'][rand(0,length(body('Get_items')?['value']))]

    At this point save the flow and run a test, and copy the contents of the output of the Compose above into a Parse JSON action:

    We then need to update the list again with the new current item. The ID is from the ID in the Parse JSON section of the dynamic content box and select Yes in the Current field.

     

    I've added a view of the list to show just the item now marked as current. I formatted that with JSON view formatting to add a dynamic link to the Wikipedia page abut the country and another one to open the map of the country in Bing Maps but you won't need those. You could just the Title column displayed in a new view of the list which is called Current Random Country..

    The web part on the page then has the following settings:

    The passphrase in this case would be the name of the country. There is a very small chance that a non-legitimate person calling might select the correct country but it is a slim chance.

    So I hope this gives you some ideas for doing something similar.  Come back with any questions.

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

Resources