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

Strange "people kind" array filtering problem

Hello,

 

I have a simple task to solve and once upon a time I had it working, but now it gave me some headaches.

 

I have to get a SharePoint list containing two columns: User (type people) and Department (type single choice) then filter by user's email. Because I found some threads mentioning I cannot filter "people" types directly in the "Get items" step I have added a second "Filter array" step.

The "filter condition" is to filter that list by the email address of the person that started the flow.

 

The problem is I cannot filter array by the "triggerOutputs()['headers']['x-ms-user-email-encoded']" directly. 

I have tried different ways and work only "as fixed value" entered in the equals to field but in this case is not useful because I need a dynamic value, and also works with a "workaround": put it first into a variable, then use the variable.

 

The details in the picture below: 

MSAutomate-FilterArray-Problem.png

 

Why is not working directly anymore?... (by "not working" I mean it does not output anything, no errors, no nothing)

I have some flows that works that way but this new flow does not.

What am I missing?... 😞

 

Kind Regards,

Lucian

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

Well,

It seems that finally "solved" the mystery.

Taking a "peek to code" for the step that "Initialize variable - get email" because with that variable worked

 

 

{
    "inputs": {
        "variables": [
            {
                "name": "tmpemail",
                "type": "string",
                "value": "@base64ToString(triggerOutputs()['headers']['x-ms-user-email-encoded'])"
            }
        ]
    }
}

 

 

...one function seems to make the difference - base64ToString because that specific email is "encoded".

The other emails used in other flows were the "created/modify by" for document properties not for executing the flow that's why this time was different.

So using the proper condition in "Filter array - using "dynamic" email - NOT WORKING" step it makes it WORKING.

 

@equals(item()?['User']?['Email'], base64ToString(triggerOutputs()['headers']['x-ms-user-email-encoded']))

 

 

So it's my mistake. 🤐

 

Kind Regards,

Lucian

 

View solution in original post

1 REPLY 1
Frequent Visitor

Well,

It seems that finally "solved" the mystery.

Taking a "peek to code" for the step that "Initialize variable - get email" because with that variable worked

 

 

{
    "inputs": {
        "variables": [
            {
                "name": "tmpemail",
                "type": "string",
                "value": "@base64ToString(triggerOutputs()['headers']['x-ms-user-email-encoded'])"
            }
        ]
    }
}

 

 

...one function seems to make the difference - base64ToString because that specific email is "encoded".

The other emails used in other flows were the "created/modify by" for document properties not for executing the flow that's why this time was different.

So using the proper condition in "Filter array - using "dynamic" email - NOT WORKING" step it makes it WORKING.

 

@equals(item()?['User']?['Email'], base64ToString(triggerOutputs()['headers']['x-ms-user-email-encoded']))

 

 

So it's my mistake. 🤐

 

Kind Regards,

Lucian

 

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (3,412)