Forum Discussion

AndyfF360's avatar
AndyfF360
Brass Contributor
May 07, 2020

Extracting custom fields from bookings

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.

  • topcat437's avatar
    topcat437
    Copper Contributor

    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
    • Steve_Prentice's avatar
      Steve_Prentice
      Iron Contributor

      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?

  • 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

    • Steve_Prentice's avatar
      Steve_Prentice
      Iron Contributor

      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! 🙂
      • Steve_Prentice's avatar
        Steve_Prentice
        Iron Contributor

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

         

         

        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!)

      • Kimberly_Huffman's avatar
        Kimberly_Huffman
        Brass Contributor
        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
    • kathopkins's avatar
      kathopkins
      Icon for Microsoft rankMicrosoft
      Thank you Kimberly for the detailed instructions! I got mine working before I found your post, but mine was over complicated compared to yours and I changed my flow to use your parsing technique and I love it!
  • Karine2411's avatar
    Karine2411
    Copper Contributor

    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!

  • sagark92's avatar
    sagark92
    Brass Contributor
    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.
  • GregCS's avatar
    GregCS
    Brass Contributor
    As an update, since the 'old look' of Bookings has been replaced with the 'new look', the Export button is no longer found on the homepage of Bookings. Now, you must go to your chosen Bookings Page, then the Bookings Calendar tab for that page - you will find the Export button on the top-right of the page above the calendar display.
    When you export, you define the date range (I've found this to be buggy, as it lists bookings being made on dates that don't add up, so allow for it to search into the past and future around the dates to be sure you capture them!?).
    You can open the .TSV with Excel, and you can see responses to custom fields here as well.

Resources