Was doing a bit more playing with Power Automate again recently and thought I would share.
This time I was looking at finding a way where staff could book on an internal training course but where there would be a maximum number of places available.
My solution involves a Form to submit requests, a PowerAutomate to manage the requests and check if a given session has capacity and a SharePoint list to store the submitted request details for those people who successfully book a place.
So the steps:
- Create a form for your staff to make their training request
- Create a SharePoint list which will store the accepted requests; The list should contain fields matching the questions within you form.
- Create the PowerAutomate to manage the submitted requests including emailing confirmations and apologies dependent on if the course is full or not.
Now I am going to detail point 3 above, as the other points are reasonably straight forward to achieve.
One of the first things we need to do is to Initialise a new variable which will be used to store the count of the number of people already booked on a course. This should be an integer variable and set initially to 0. Within the PowerAutomate we will change the value later based on the number of records in the SharePoint list.
Next I am using a Get Items action to get all of the items from the SharePoint list. This will get you all the records submitted so far which is basically a list and count of the number of people already booked on the course.
We now need to set the variable so that it stores the count of the number of records already in the SharePoint list. To do this use a Set Variable action. Within the value of this action we want to use an expression using the expression below:
Note GetItems should be the name of the Get Items action mentioned earlier. This expression will basically count the number of records in the SharePoint list as accessed via the earlier Get Items action.
From here it is simply a case of using a Condition to check if the variable is less than or equal to you maximum number of attendees, and then send out appropriate emails either acknowledging acceptance on the course or indicated that the course is currently full.
And so, we have a basic little CPD course booking process complete with maximum number of attendees and confirmation emails.