
Hi,
This has me stumped.
I had a working flow that posted a Teams message and sent an email when a button was clicked on a Power BI report.
I had to recreate/migrate this to a new account. It was a simple flow so I recreated from scratch on the new account.
Created from within the Power BI report.
I am now getting an error. This occurs from both the owner account or a 'run as' account from both PBI Desktop and the report published to the service.
Error:
The 'inputs.parameters' of workflow operation 'Send_an_email_(V2)_2' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'emailMessage/To' is required to be of type 'String/email'. The runtime value '"eGEtcG93ZXJBdXRvbWF0ZUBjMy5jby5ueg=="' to be converted doesn't have the expected format 'string/email'.
Raw Input (replaced sensitive info with 'myData'):
{
"host": {
"connectionReferenceName": "shared_office365_1",
"operationId": "SendEmailV2"
},
"parameters": {
"emailMessage/To": "eGEtcG93ZXJBdXRvbWF0ZUBjMy5jby5ueg==",
"emailMessage/Subject": "Cart In by Month exported at 2022-05-25T04:42:15.9071601Z",
"emailMessage/Body": myData,
"emailMessage/Attachments": [
{
"Name": "2022-05-25T04:42:15.9071601Z.csv",
"ContentBytes": myData
}
]
}
}
Flow:
Any help appreciated.
Thanks,
Kim
Well, that was frustrating.
After digging into the output of the trigger action, I found the issue, and it's a new one because this was previously working fine.
When you edit the button from PBI Desktop and create your flow. Choosing the 'User Email' from the available content, i.e. from the button clicked trigger action, gives the encoded version. (ignore the 'x-ms-user-email' in the image, that was added in the solution below)
Solution
I couldn't fix this from PBI Desktop as you don't have access to the expression editor, so I went to Power Automate and edited the flow. Go to the expression editor, select the 'User email' and remove the '-encoded'.
Replace the 'User email' in the Teams and Email action with the output from this compose.
Hope this saves someone else some time.