Forum Discussion
Extracting custom fields from bookings
- Jan 17, 2021
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
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
Thank you for this excellent guide.
It worked well for us.
One thing though, we are occasionally getting extra garbage data or weird conversions from HTML to text.
When there is two or more blank spaces between two words entered in a custom field, we end up with a " " replacing the first blank space in the exported csv file. Customers must adding extra spaces accidentally when making their bookings.
Any recommendations on filtering out illegal characters or extra spaces from the custom field items within the body of a calendar item?
Perhaps with a nested "Apply to each" with something like this?
https://www.alanps1.io/power-platform/flow/flow-stripping-unwanted-characters-or-special-characters-from-a-string/
or this:
https://debajmecrm.com/how-to-remove-trailing-spaces-and-extra-spaces-in-a-string-in-power-automate/
Or is that just overcomplicating it all?
- kathopkinsFeb 02, 2022Copper Contributor
BenDaMAN : Using the function trim(string) as it is in the link you put in works for leading and trailing white space also. It does not work for newlines and carriage returns and does not work for the middle of the string.
I use a combination of functions to get rid of anything 'illegal' like the ones above.
For getting rid of multiple spaces between words use:
replace(variables('temp'), ' ', ' ')
just literally type 2 spaces in the first '' and 1 space in the second. Or if you have white spaces that are not consistent like that, you can always try a regular expression replace.
For new line/carriage return combos (if those cause an issue), I first use the encodeUriComponent to code the string, then I use the replace() to turn them into either space of another character that I may need like this:
replace(encodeUriComponent(variables('temp') ), '%2C%0A', ', ')
the above will first encode all chars to UTF-8 chars, then replaces the \n\r combination with a comma followed by a space. This use case was specific to my needs when the user enters new lines into a custom field that should not have new lines in.
You can just make that fit your special char needs.
Hope this helps