Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Using ID from For a Selected Item for Get Items

(0) ShareShare
ReportReport
Posted on by 116

Hi There,

 

I am trying to trigger a csv report from a Sharepoint list to pull together rows that have a column value in common. I have added trigger buttons to the list, and it does indeed work. 

The problem is, I can only create my csv table with all rows. Or if I use ID from the previous stage, I can have just that single row.

 

What I want is all the rows with some other column values in common.

For example, if my chosen row contains Modified By 'Tom', I would like flow to collect all records modified by Tom.

But I want to return all items modified by the same person as the selected row. I have no static interest in Tom.

 

I only have ID available from my Selected Item, and no other columns to draw from.

 

What would be the syntax for that in my Filter Query?

Or is there some other way of doing this at the front end with my trigger button?

 

Many Thanks in advance for any help

Max

 

My flow...

 

Untitled.png

  • maxtarneberg Profile Picture
    maxtarneberg 116 on at
    Re: Using ID from For a Selected Item for Get Items

    Fabulous! That worked

     

    Thank you very much @Pstork1  and @v-litu-msft for your help.

  • Verified answer
    Pstork1 Profile Picture
    Pstork1 65,019 on at
    Re: Using ID from For a Selected Item for Get Items

    For CertNo use a Flow like the one in my previous post and in the OData query line add a filter that uses the CertNo dynamic content that was retrieved in the Get Item action. In the OData query type the following and then add the CertNo field from the dynamic content panel

    CertNo eq '<CertNo Field Goes Here>'
  • maxtarneberg Profile Picture
    maxtarneberg 116 on at
    Re: Using ID from For a Selected Item for Get Items

    Thank you @Pstork1 and @v-litu-msft for your help. It is much appreciated.

     

    I have tried at the solutions provided, but I feel they are relying on a static filter query unless I am misunderstanding (entirely likely!) I don't always want to find just Tom. I'm looking for a more dynamic lookup.

     

    So, I am still struggling with this, let me illustrate the scenario better, as I'm sure this must be possible:

     

    In this example table below, how would I create the filter query to return all rows that share the same CertNo as the row I click the Flow button on.

     

    So if I clicked the button on the....

    Top row -  3 records would be returned (IDs 1,2,& 6), as they all share the CertNo of '123456'

    Third row - 2 records (IDs 3 & 5), all with CertNo '959595'

     

    DataCertNoIDButton
    Good1234561[Run Flow]
    Bad1234562[Run Flow]
    Ugly9595953[Run Flow]
    Good6543214[Run Flow]
    Bad9595955[Run Flow]
    Ugly1234566[Run Flow]

     

    I hope this makes sense, and thanks again.

  • v-litu-msft Profile Picture
    v-litu-msft on at
    Re: Using ID from For a Selected Item for Get Items

    Hi @maxtarneberg,

     

    This is the syntax of the Filter query:

    Operator Description Example
    Logical Operators
    Eq Equal /Suppliers?$filter=Address/City eq 'Redmond'
    Ne Not equal /Suppliers?$filter=Address/City ne 'London'
    Gt Greater than /Products?$filter=Price gt 20
    Ge Greater than or equal /Products?$filter=Price ge 10
    Lt Less than /Products?$filter=Price lt 20
    Le Less than or equal /Products?$filter=Price le 100
    And Logical and /Products?$filter=Price le 200 and Price gt 3.5
    Or Logical or /Products?$filter=Price le 3.5 or Price gt 200
    Not Logical negation /Products?$filter=not endswith(Description,'milk')
    Arithmetic Operators
    Add Addition /Products?$filter=Price add 5 gt 10
    Sub Subtraction /Products?$filter=Price sub 5 gt 10
    Mul Multiplication /Products?$filter=Price mul 2 gt 2000
    Div Division /Products?$filter=Price div 2 gt 4
    Mod Modulo /Products?$filter=Price mod 2 eq 0
    Grouping Operators
    ( ) Precedence grouping /Products?$filter=(Price sub 5) gt 10

     

    If you want to get the items modified by Tom directly in the filter query of the Get items, I think it is hard to do, because of the Midified by field is a column of personality type, the displayName could not be used in filter query.

     

    How about using the filter query action after Get items without any filter? It could achieve your requirement:

    Annotation 2020-01-07 154423.png

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Pstork1 Profile Picture
    Pstork1 65,019 on at
    Re: Using ID from For a Selected Item for Get Items

    Just add a Get Item action (not get Items) just before the existing Get Items action.  Then use the ID from the selected Item trigger.  That should give you access to the fields you need to create an OData query in the Get Items.

    screenshot.png

  • maxtarneberg Profile Picture
    maxtarneberg 116 on at
    Re: Using ID from For a Selected Item for Get Items

    Hi @Pstork1 

     

    Thank you for your quick response.

     

    I'm not I follow though, sorry.

     

    Does that mean create another Get Items stage?

    I don't know how to draw all my other fields from the Selected Item from the trigger

     

    Would it be possible for you to elaborate please?

    Thank again

  • Pstork1 Profile Picture
    Pstork1 65,019 on at
    Re: Using ID from For a Selected Item for Get Items

    Using the ID from the Selected Item you can always do a Get Item to get the values for that item, but you should have all the fields in the selected item available from the trigger.  Then use those values in a Get Items OData query filter or for Filtering the array of the items returned in a Get items.

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,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard

Featured topics