cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maxtarneberg
Level: Powered On

Using ID from For a Selected Item for Get Items

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

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

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>'


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

7 REPLIES 7
Dual Super User
Dual Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
maxtarneberg
Level: Powered On

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

Dual Super User
Dual Super User

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



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

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.

Highlighted
maxtarneberg
Level: Powered On

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.

Dual Super User
Dual Super User

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>'


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

maxtarneberg
Level: Powered On

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.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors
Users online (5,952)