Skip to main content

Notifications

Power Automate - General Discussion
Answered

Select statment from a Filter Array

(0) ShareShare
ReportReport
Posted on by

Hi,

im runing a flow which suppose to get a list of items from excel than im filtering it with Filter array.

i want now to select a subset of the columns and cant find the right syntex for that, first i tried to use 

"Owner":"@body('Filter_Owner')?['Owner']?['Value']"

i got following error:

InvalidTemplate. The execution of template action 'Select_2' failed: The evaluation of 'query' action 'where' expression '{ "Owner": "@body('Filter_array')['Owner']", "Status": "@body('Filter_array')['Status']" }' failed: 'The template language expression 'body('Filter_array')['Owner']' cannot be evaluated because property 'Owner' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

 

i saw a suggestion in the forum to use following syntax:

"Owner":"@item()?['Owner']?['Value']

but it also not working, getting the following error:

InvalidTemplate. The execution of template action 'Select_2' failed: The evaluation of 'query' action 'where' expression '{ "Owner": "@item()['Owner ']['Value']", "Status": "@item()['Status']['Value']" }' failed: 'The template language expression 'item()['Owner ']['Value']' cannot be evaluated because property 'Owner ' doesn't exist, available properties are '@odata.etag, ItemInternalId, Risk ID, Area​, Team Res_x002e_​, Owner​, Mail, Status, Description​, Severity​ (1-5)​, Probability​ (1-5)​, Rating​ (S x P)​, Mitigation​, Contingency​, Comments​, __PowerAppsId__'. Please see https://aka.ms/logicexpressions for usage details.'.

 

 

it said that property owner dosent exist although it is mentioned on the propery list afterward...

any suggestions?

 

regards,

Eyal

  • Kashif_ptcl Profile Picture
    Kashif_ptcl 26 on at
    Re: Select statment from a Filter Array

    HI 

     

    Could you help to dynamically select the Manager name in email body. I'm not able to pick dynamically pick up the Manager name while sending him the email and address him in the email body. 

  • Kashif_ptcl Profile Picture
    Kashif_ptcl 26 on at
    Re: Select statment from a Filter Array

    Hi faustocapellanj,

     

    Could you please help with the flow after I posted the screenshots. 

  • Kashif_ptcl Profile Picture
    Kashif_ptcl 26 on at
    Re: Select statment from a Filter Array

    Thanks for your response.

     

    Below is the data set in excel. 

     

    data set.PNG

     

    I have got all the Managers as below successfully after union.

     

    Set Manager Name.PNG

    I got the Managers emails below.

     

    Manager Email.PNG

    I got the below flow for Unique Owner .

    Unique owner loop.PNG

     

    Please see below the details of above flow 

     

    1.PNG2.PNG3.PNG4.PNG5.PNG6.PNG

     

    Please note that the emails are successfully going without dynamically adding the Manager Name. When I add the Manager Name dynamically after Dear, i'm getting the above error. 

  • faustocapellanj Profile Picture
    faustocapellanj 1,662 on at
    Re: Select statment from a Filter Array

    Hi @Kashif_ptcl 

    If you are using a Person field in SharePoint, the field will give you multiple properties within it. Let's say you are doing the union() expression as 

    union(variables('arrayOwnersName'), createArray(item()?['Owner']))

    the variable should have additional properties for each person, such as DisplayName and Mail. So, to add the name of the person, you can do an expression similar to this item()['DisplayName']. If you can post some screenshots so I can see exactly what your flow looks like, that will be better.

    Regards,

  • Kashif_ptcl Profile Picture
    Kashif_ptcl 26 on at
    Re: Select statment from a Filter Array

    Hi @faustocapellanj 

     

    I have implemented your solution successfully. How do I include the Owner Name dynamically in email body by addressing him with his Name dynamically while sending email.  

  • Kashif_ptcl Profile Picture
    Kashif_ptcl 26 on at
    Re: Select statment from a Filter Array

    Hi @faustocapellanj 

     

    I have implemented your solution of sending an emails to only unique email addresses with the list of items they own. However I want to dynamically add the Owner/Manager name in email body by addressing him. I have  tried several different options to include Name too in the "For each Unique Owner" loop but its not working. Could you please help which steps do I need to add in the flow. 

  • faustocapellanj Profile Picture
    faustocapellanj 1,662 on at
    Re: Select statment from a Filter Array

    Hi @Perez

     

    Just sent you a private message. See if you can export your flow as .zip and share it.

  • Re: Select statment from a Filter Array

    Hi @faustocapellanj,

    actually I put it exactly the way you showed in the expression field, it’s very weird because for the 'Risk ID' and 'Status' fields, it is ok, if I’m running the flow only  with these two it works but when trying to add in 'Description', 'Owner',  and 'Area' it gives the error I attached below.

    any idea?

     

    thanks 

    Eyal

  • faustocapellanj Profile Picture
    faustocapellanj 1,662 on at
    Re: Select statment from a Filter Array

    Hi @Perez

     

    I see that the additional properties, such as Area, are available for selection. I was able to select those additional properties in my Flow; you can see the step and the results in the screenshots below:

    Action with ExpressionAction with Expression

    OutputOutput

    Please check the expressions for the properties to make sure it matches the expression in the screenshot above and let me know.

     

  • Re: Select statment from a Filter Array

    Hi @faustocapellanj,

    im just typing it in the expression field

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard