tl;dr
If you have email addresses coming from somewhere and you’re using them in Power Automate to filter and find the records, make sure to double the quotes.
Full story
One of the observations made by our lifetime tipster Jerry Weinstock was that citizens tend to create automations that follow happy path. I have to say this turned out to be valid for yours truly as well.
Am I becoming a citizen?! o__O
The Enabler
I was processing some records that came from a spreadsheet and needed to look up CDS records by email. That part of my flow looked something like this:
Happy – 3000, unhappy – 2. Diving in.
That explains it. According to RFC5322, the recipient part may use any of these ASCII characters:
- Uppercase and lowercase English letters (a–z, A–Z)
- Digits 0 to 9
- Characters ! # $ % & ‘ * + – / = ? ^ _ ` { | } ~
- Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively (e.g. John..Doe@example.com)
All of these characters are probably fine except the quote that breaks the fragile syntax of JSON land. So the expression catering for unhappy path has become:
And everyone is happy now, including the unhappy path with 6 quotes in a row.
Photo by Dominika Gregušová from Pexels
This tip helped me also solve filtering on an e-mail address in the XRM.SDK
with the Get-CrmRecords or Get-CrmRecordsByFetch commands.
Luckely i could use double quotes in powershell.
Thanks.