Forum Discussion
Custom Fields in Microsoft Bookings
- Oct 13, 2020
You will need to extract custom fields values using graph. You will need to filter with the following (use the exact same values). Then the returned value will need to be Base64 Decoded. I'm using this with Power Automate that start whenever a new event created (Outlook new event), extract the info and put into a SharePoint list.
https://graph.microsoft.com/beta/users/[BookingMailboxAddress]/events/[event Id]?$expand=singleValueExtendedProperties($filter%3Did eq 'Binary {ccb88e73-951a-4b10-bb49-e6628b8d8494} Name BookingItemAnsweredCustomQuestions')
https://docs.microsoft.com/en-us/graph/api/user-list-events?view=graph-rest-beta&tabs=http
You will need to extract custom fields values using graph. You will need to filter with the following (use the exact same values). Then the returned value will need to be Base64 Decoded. I'm using this with Power Automate that start whenever a new event created (Outlook new event), extract the info and put into a SharePoint list.
https://graph.microsoft.com/beta/users/[BookingMailboxAddress]/events/[event Id]?$expand=singleValueExtendedProperties($filter%3Did eq 'Binary {ccb88e73-951a-4b10-bb49-e6628b8d8494} Name BookingItemAnsweredCustomQuestions')
https://docs.microsoft.com/en-us/graph/api/user-list-events?view=graph-rest-beta&tabs=http
We have bookings that return the standard fields using:
https://graph.microsoft.com/beta/users/[BookingMailboxAddress]/events/[event Id]
Within the body content of the returned data I can see there's custom fields e.g.
Custom Fields<br>
----------------------<br>
Question 1- ...<br>
Answer- ...<br>
Question 2- ...<br>
Answer- ...<br>
<br>
However, when I extend the call with the Extended Properties it doesn't return the additional fields:
https://graph.microsoft.com/beta/users/[BookingMailboxAddress]/events/[event Id]?$expand=singleValueExtendedProperties($filter%3Did eq 'Binary {ccb88e73-951a-4b10-bb49-e6628b8d8494} Name BookingItemAnsweredCustomQuestions')
I'm simply copying and pasting and replacing the mailbox and event ID so struggling to see what I'm missing. Do you have any suggestions?
Thanks very much!
- Martin-CoupalJan 22, 2021Iron ContributorJust in case, are you using group event scheduling (multiple participants) in your service configuration? If that's the case it will not work.
- Kimberly_HuffmanJan 22, 2021Brass Contributor
Martin-Coupal No I'm not and and you're correct, this will not work for group events. I noted that in the document I attached to my original post.
- Martin-CoupalJan 22, 2021Iron Contributor
Kimberly_Huffman , I was replying to jbailiss question...
Thanks.
- Kimberly_HuffmanJan 17, 2021Brass Contributor
jbailiss I was able to extract custom field data successfully using Power Automate. Lobsang_aka in case you have future needs. Martin-Coupal here is another approach 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- ArlartJan 21, 2022Copper Contributor
Kimberly_Huffman Thanks a lot for the documentation. It helps a lot.
The only challenge i have is that it doesnt work with the customs fields. I think the problem is CRLF between the the question and the answer. Any idea how i can get this into the function?
Calendar Event:
Benutzerdefinierte Felder
----------------------
Frage 1–Geburtsdatum
Antwort – 1.12.2021
Frage 2–Ausweisnummer
Antwort – 0Current workaround:
trim(last(split(first(split(outputs('HTML_zu_Text')?['body'],'Frage 2')),'Frage 1–Geburtsdatum')))
The problem is that the return is --> "Antwort – 1.12.2021"
I tried to use substr, but that doesnt work....
- ArlartJan 23, 2022Copper Contributortried now the substring() function.
now it works....
trim(last(split(first(split(outputs('HTML_zu_Text')?['body'],'Frage 3')),'Frage 2–Ausweisnummer')))
substring(trim(last(split(first(split(outputs('HTML_zu_Text')?['body'],'Frage 3')),'Frage 2–Ausweisnummer'))),10)
- mhannahMar 05, 2021Copper ContributorKimberly_Huffman I have followed your instructions exactly and the flow works and I even see where the csv file says it has been modified, but nothing is showing up. I cannot understand what I am doing wrong. What do I have to do with the csv file to make the events show up?
- ddmurrayjrJan 21, 2021Copper Contributor
Kimberly_Huffman We're trying to extract the custom field information and populate excel with the caveat being we have multiple bookings services with overlapping times. I setup the multiple services because the group appointments don't show the custom data in the calendar event. In theory we can have up to six appointments, with six services, all at 9am. I'm totally new to power automate and don't have a clue as to how to capture the data. Any ideas?
- Kimberly_HuffmanJan 21, 2021Brass Contributor
ddmurrayjr Tell me about the staff accounts you have assigned to each service. It's those staff account calendars that Power Automate will tap into to capture the information.
Because I don't know your exact situation I could be very wrong, but I don't think you need 6 different services, just 6 "staff" accounts. Let me explain our scenario and our setup.
Our specific use is to allow employees to schedule vaccination appointments. We have 4 nursing stations providing vaccinations every 5 minutes. With our setup we can schedule 4 employees every 5 min- We created 4 office accounts, 1 for each nursing station (Nurse1, Nurse2, etc.) These accounts have email addresses and outlook calendars. Make sure you get access to these accounts.
- We created a single Booking service (Vaccination) with a default duration of 5 min, max attendees 1, and custom fields.
- We assigned the 4 Nurse accounts as the assigned staff for the service.
- So I could access these account's calendars using Power Automate, I added the 4 accounts to my Outlook account by selecting Add Account on the Info page of Outlook.
- We created a Power Automate flow for each Nursing station account to capture the appointment details (I have 4 flows running nightly - Nurse1, Nurse2, etc.)
In Power Automate, to make the connection to the staff calendar (in my scenario the nursing station account) do the following:
- Once you have added the Get calendar view of events (V3) action to your flow, click on the action's menu (the ellipsis located in the action's title bar)
- Select the staff account under My connections or if necessary, select +Add new connection, select the staff account and provide the account password.
Using the document I attached to the original post, add the remaining actions. Let me know if you have any specific questions about the flow or anything else I can do to help you get started.
~Kimberly
- Martin-CoupalJan 10, 2021Iron Contributor
jbailiss ,
Sorry for late reply,
When calling the API, what is the JSON response? You should find something like this is the response.
"singleValueExtendedProperties": [{"id": "Binary {ccb88e73-951a-4b10-bb49-e6628b8d8494} Name BookingItemAnsweredCustomQuestions","value": "W3siQW....."}]