MS Bookings app event data



MS Bookings app event dataCurrently, the MS Bookings app doesn’t provide a report containing the details of a booked service, specifically any custom field values a customer provides when booking a service. The following Power Automate flow generates a nightly CSV report containing those details. When a service is scheduled in the Bookings app, an event is created in a calendar. This calendar event contains all the data entered by the customer when they booked their appointment so, by using a nightly recurring Power Automate flow I was able to parse the data from the events and store in a CSV file. There are other methods of logic that can be used, such as any time an event is created or modified, update a SharePoint list; however, for our organization needs this approach worked best. Please note this solution does not work where the maximum number of attendees per event is more than 1, because in a group event customer details are not available in the calendar event.Below is an example of a scheduled event created by the Bookings app.Power Automate flow to extract information (standard and custom) from the calendar event and store in a CSV file.53149502579370These are string variables used to store the information being parsed from the calendar event.0These are string variables used to store the information being parsed from the calendar event.right1943100The data array variable stores the variable values from the events.00The data array variable stores the variable values from the events.Note: We were booking appointments every 5 min so due to the volume of possible events per day, I created a scope of actions for each week. The scoped actions are identical except for the start and end times in the Get Calendar view of events (V3) actions.55299221458986The Html to text action converts the body of the event to text so it can be parsed.0The Html to text action converts the body of the event to text so it can be parsed.Note: Using the expressions below I parsed information from the body of the calendar event (see an opened calendar event at the beginning of this document). For example, to parse the Employee ID number, the expression captures everything after the text “Answer-<space>“ through the beginning of text “Internal”. I used the Trim function to remove the hard returns. Examples of a few other expressions doing the same type of parsing are listed belowExpression for Emp IDtrim(last(split(first(split(outputs('Html_to_text')?['body'],'Internal')),'Answer-?')))Expression for the Nametrim(last(split(first(split(outputs('Html_to_text')?['body'],'Email')),'Name:?')))Expression for the Email addresstrim(last(split(first(split(outputs('Html_to_text')?['body'],'Phone')),'Email:?')))right1857375Anytime I use Power Automate to provide a date and time in output, I must convert it to my time zone. Here I am converting the start time of the event to CTS. Even though the event is being stored in the calendar in CTS, it still must be converted.00Anytime I use Power Automate to provide a date and time in output, I must convert it to my time zone. Here I am converting the start time of the event to CTS. Even though the event is being stored in the calendar in CTS, it still must be converted.52482756943725This looks for a file named Calendar2.csv in the document library.0This looks for a file named Calendar2.csv in the document library.right4467225This creates my CSV table using the values in the Data array.0This creates my CSV table using the values in the Data array.right1781175Each of these scoped actions are identical to the above illustrated, the only difference is the time frame used.00Each of these scoped actions are identical to the above illustrated, the only difference is the time frame used. 471267779131If the file exists, it overwrites; otherwise, it creates a new file. Both using the data from the Create CSV table action.00If the file exists, it overwrites; otherwise, it creates a new file. Both using the data from the Create CSV table action.Expression used in the above Conditionlength(outputs('Get_files_(properties_only)')?['body/value']) ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download