Search code examples
power-automatepowerapps

Why is my flow's "Send an Email" action using a guid instead of calling user's email address


The final step of my flow uses "Send an email (V2)" to deliver results to the calling user. It is erroring on the recipient email address:

Error message

I have also tried the alternative actions "Send email with options" and "Send an email from a shared mailbox (V2)" and both are throwing the same error.

The error title is "OpenApiOperationParameterTypeConversionFailed".

The dynamic content I am using is the only "user email" dynamic I can find: Action setup

The flow fails, indicating that "Input parameter 'emailMessage/To' is required to be of type 'String/email' and that the guid provided at runtime (naturally) isn't an email address.


Solution

  • By continuing to experiment and research, I found that entering:

    triggerOutputs()['headers']['x-ms-user-email']
    

    ...into the Dynamic Content | Expression setting is a workaround for this issue though I still do not understand why it is happening. Workaround illustration