cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pokerref
Regular Visitor

'Apply_to_each' failed

Hi,

I am a beginner with power automate.

 I'm trying to use a connection in Power BI to send a email at several people when the button is pushed on my dashboard. the email is personalized for each person.  I have a table with the name of th person: 

pokerref_0-1642681908229.png

 

I try to read table line by line with a Aplly to each by I have this error:

'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['entity']?['Power BI values']' is of type 'Null'. The result must be a valid array

pokerref_1-1642682008868.png

I don't understand this error, because my table is not null. I tried to find the solution on internet but I haven't found a solution that works.

 

 

The code in the On Power BI button cliked

{
    "kind""ApiConnection",
    "splitOn""@triggerBody()['rows']",
    "inputs": {
        "schema": {
            "type""object",
            "properties": {
                "rows": {
                    "type""array",
                    "items": {
                        "type""object",
                        "properties": {
                            "entity": {
                                "type""object",
                                "properties": {
                                    "Power BI values": {
                                        "type""array",
                                        "items": {
                                            "type""object",
                                            "properties": {
                                                "Nom Salarié": {
                                                    "title""Power BI data Nom Salarié",
                                                    "type""string"
                                                }
                                            },
                                            "required": []
                                        }
                                    }
                                },
                                "required": [
                                    "Power BI values"
                                ]
                            }
                        },
                        "required": [
                            "entity"
                        ]
                    }
                }
            },
            "required": [
                "rows"
            ]
        },
        "host": {
            "connection": {
                "name""@parameters('$connections')['shared_powerbi']['connectionId']"
            }
        },
        "operationId""PowerBiButtonClicked",
        "parameters": {
            "inputsPowerBiData""{}",
            "pbi_source""powerAutomate"
        }
    },
    "metadata": {
        "operationMetadataId""718e49ad-18f7-441c-9a76-1e859c576e51"
    }
}
 
Any help would be greatly appreciated!
0 REPLIES 0

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Top Solution Authors
Users online (2,897)