SOLVED

Extracting custom fields from bookings

Brass Contributor

Hi trying to setup a booking system for customers attending a site.

Due to social distancing, we have to limit the number of spaces available and we have successfully manged to set this up using bookings . We have added a custom field of Car registration that must be provided at time of booking so we can validate entry quickly.

 

Does anyone know of a way that this can be extracted from bookings along with other booking information, so we can hand a list to the security guy at the gate for quick checks?

 

We have downloaded the TSV file  but this dos not give custom field information.

 

Any help would be greatly appreciated.

24 Replies

Je suis dans le même bâteau. Je cherche à extraire un rapport qui inclue les champs personnalisés Celui-ci serait intégré dans notre CRM. merci!

Hi,

One way to go about it is to add this calendar to your outlook calendar and then use print> daily or weekly (whichever you prefer >detailed agenda (tick this option).
This shall give you all the information. Hope that helps.

Thanks @sagark92, this partially works but the feature is lacking built-in export of the configured custom fields. Getting a detailed page for each meeting/booking with the complete details is simply doesn't scale. You would need some OCR to transpose that to an Excel spreadsheet.

 

I have raised this issue in the User Vote community for this to become available and it has been pending moderator approval for multiple days.

 

https://techcommunity.microsoft.com/t5/microsoft-bookings/microsoft-bookings-reports/m-p/197177/

 

They are sitting on this since they released the TSV export years ago.

https://outlook.uservoice.com/forums/314907-microsoft-bookings/suggestions/15773461-custom-fields-on...

 

Have you seen other ways to get access to these custom fields?

@AndyfF360 

I used Power Automate (Flow). 
1. MS Bookings uses Exchange
2. Get your admin to set the password for the email account the Bookings calendar uses
3. Assign Echcange license so you can trigger Flow on the creation of an Outlook event. In the video, she uses 'Get Bookings' action but that's now 'When an event is added, updated or deleted. v3'
4. Trigger on new event added and read the event data and it's all there. Extract the info from the text of the Event body which includes the custom field questions asked.
So stupidly simple !!!!!!! but took me hours of head-scratching and Googling.
My Bookings data now goes into a sharepoint list. 
Edited

@topcat437 Thanks... I like your idea and doing it right now.

A couple of follow up questions if I may?

For us, changing the password and licencing seems to have made the booking calendar "disappear" from the admin portal, you can still get to it by a direct link, but no longer search for it, did you find that?

The data gets returned in "body" and is just a load of HTML, which is horrendous to search for the data and make it easily usable, did you find anything nice to help with that, or just pure hard work with substring() to save it in to variables?

best response confirmed by kathopkins (Microsoft)
Solution

@AndyfF360  I was able to extract custom field data successfully using Power Automate so in case you have future needs. @Karine2411 , @sagark92 , @maynarp , @topcat437 , @Steve Prentice  in case you are interested.

 

Flow Description

This flow runs nightly and extracts user data from events located in a custom account calendar (this account is being used by the Bookings app to schedule appointments) then creates a CSV file stored in a Shared Documents team library.  Attached are the details of my solution.

Hope this helps!
~Kimberly

@Kimberly_Huffman Hey Kimberly... thanks so much for taking the time to share, I'm sure there's lots of others that'll find that really useful. Interestingly enough that looks scarily similar to my Logic App! Great minds and all that. :) (Looks like we're doing exactly the same too, bookings for covid jabs for people like ASC)

 

I did find the need to do this:

 

replace(items('For_each')?['body'],'’', '''')
 
For names like O’Connor, it needed to convert them to O'Connor (subtle, but there's a different apostrophe there)... Didn't quite track down where the bug is, but I suspect as it converts to CSV it takes the ’ char and makes it "’" in the resulting CSV if you don't do the find and replace first.
 
Maybe your conversion from HTML to Text helps with that, I didn't bother... maybe I should! :)

@Kimberly_Huffman This is also a nice way to get Name (for example):

 

strName.jpg

 

You can't do that easily in Designer view, but if you drop in to Code view you can use "\n" to look for the end of line and split by that.... I'm just updating my code to using that way to do it in the hope that if someone changes things around in the Booking form that it doesn't break it in the code here quite so much. (Previously I was splitting by <br>, but now I've gone for the html to text convert as you've done!)

We're also finding limits of the amount of data that the Events connector seems to export... we're trying to export a date range of 7 days, yet the data gets truncated after a couple of days... very frustrating.

@Steve Prentice I know! I feel your pain. It seems that it will only pull about 255 records with the Get Calendar events action. That's why I created multiple scopes with a defined date range that wouldn't exceed 255. Luckily, the array variable was able to hold them all and I didn't have to create multiple arrays. 

@Steve Prentice Thanks! That's a great tip and will be going back to modify my code to do the same!!

@Kimberly_Huffman  is it possible to export the Power App solution and share it?  Thank you for your help!! 

Hi! Unfortunately I cannot; however, the document I attached earlier in this thread has all of my steps. If there are any particular steps, actions, etc. you have questions about, I'll be more than happy to answer.
~Kimberly

@Kimberly_Huffman 

Thanks so much for this.

When choosing the Calendar ID, I do not have the option for the MS Booking calendar, only those attached to my own mailbox.  What can I do to troubleshoot this?

 

Thanks

Hey DashBois... Further up in the thread there's a post from topcat437 which outlines some pre-reqs, to paraphrase...


2. Get an admin to set the password for the Bookings calendar's email account
3. Assign Exchange license

 

Not sure that's in Kimberly's doc... It could be that you need to do that bit if you haven't already?

Cheers

@DashBois - we created 4 exchange accounts, each representing a staff being used in MS Bookings. I added the accounts to my Outlook account which then made them show up in the Calendar ID drop down. I have since removed those accounts from my Outlook and the flows are still working.
Brilliant solution! was scratching my head trying to figure out a way to extract this data
Thanks! And good news - the .TSV file now includes the custom fields.
Worked like a charm!
1 best response

Accepted Solutions
best response confirmed by kathopkins (Microsoft)
Solution

@AndyfF360  I was able to extract custom field data successfully using Power Automate so in case you have future needs. @Karine2411 , @sagark92 , @maynarp , @topcat437 , @Steve Prentice  in case you are interested.

 

Flow Description

This flow runs nightly and extracts user data from events located in a custom account calendar (this account is being used by the Bookings app to schedule appointments) then creates a CSV file stored in a Shared Documents team library.  Attached are the details of my solution.

Hope this helps!
~Kimberly

View solution in original post