Search code examples
power-automate

How to get values of received main on PowerAutomate flow with received mail trigger


I have this trigger where, when receiving a mail, it gets all the data:

value from the email

I then initialize a variable "correo-rte" and set it to the following value:

enter image description here

but even though the first image shows that the 'from' property is received correctly, this is the value outputed to the variable:

enter image description here

ChatGPT and co-pilot both tell me to use triggerBody()?['from'] but that doesn't seem to work either. I'm new to this PowerAutomate thing, so I don't know if it is my fault or if there's something else happening.

I need this variable with the correct data to send a response, which I tried both of this ways:

Attempt 1

enter image description here

Attempt 2

enter image description here

None of this worked, so I'm out of ideas.


Solution

  • In this case ChatGTP and Copilot might be wrong.

    I see your trigger action returns a value property. This suggests that you are receiving multiple emails instead of one. It is very likely that the Split on setting might have been disabled in your trigger action.

    In that case try and use the below expression to retrieve the first item of the value property and from that item get the from value:

    first(triggerOutputs()?['body/value'])['from']
    

    Alternatively, you can also enable the Split On setting and use your original expression.