cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Sharepoint Get items in a specific order

Hello,

 

I use Get items action in my flow with an OData filter query: Email eq 'Choice1Email' or Email eq 'Choice2Email' or Email eq 'Choice3Email'. Email ,Choice1Email,Choice2Email and Choice3Email are single line text fields in SPO, ChoiceEmail fields are from trigger item. I am trying to get the items in the particular order mentioned in the query and use it in apply to each action in the same order(sometimes the Choice1Email or Choice2Email or Choice3Emaill can be empty). 

 

1.Choice1Email

2.Choice2Email

3.Choice3Email

 

By defualt Get items retrives items in the ascending order of created field, Also I could sort by modified and other criteria but could not get this particular order.

 

Is there any other way than using 3 get items action and creating a collection out of it and feeding it to Apply to each action, Any suggestions?

8 REPLIES 8
Highlighted
Super User III
Super User III

Re: Sharepoint Get items in a specific order

Hi @ck25415 

 

Did you tried using ChoiceEmail orderby asc?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Post Patron
Post Patron

Re: Sharepoint Get items in a specific order

@abm  I cannot, as there are three fields Choice1Email, Choice2Email, Choice3Email and I cannot use one particular field to sort.

Highlighted
Super User III
Super User III

Re: Sharepoint Get items in a specific order

Hi @ck25415 

 

Thanks for your quick reply.

 

You can sort orderby Choice1Email asc, Choice2Email asc, Choice3Email asc. I might be missing something here?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Post Patron
Post Patron

Re: Sharepoint Get items in a specific order

@abm I tried that, it gave me expression invalid error.

Highlighted
Super User III
Super User III

Re: Sharepoint Get items in a specific order

Hi @ck25415 

 

Please see this post

 

https://powerusers.microsoft.com/t5/Building-Flows/Sytnax-for-Odata-Order-By/td-p/55185

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Post Patron
Post Patron

Re: Sharepoint Get items in a specific order

@abm Thanks, I went through it, in the post OP was trying to sort using multiple columns from the same list where items are being retrived from but I am trying to sort using a value that I gave in the filter query which is from a different list. 

 

Not sure if I am missing something here.

Highlighted
Community Support
Community Support

Re: Sharepoint Get items in a specific order

Hi @ck25415 ,

 

Could you please explain more details about your requirement?

What is the difference between your scenes and the post OP? Please explain more details about the difference for the filter query which is from a different list that you mentioned.

 

Best regards,

Alice       

 

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

Highlighted
Post Patron
Post Patron

Re: Sharepoint Get items in a specific order

Hello @v-alzhan-msft,

 

In the below query the get items retrives 0-3 items(not more than that) and I want the retrived items in the order of query.

 

1. Email that matches Choice1email 

2. Email that matches Choice2email 

3. Email that matches Choice3email 

 

If I leave the order by query empty, I get the items in the created ascending order.

 

Capture.JPG

 

If I have the order by query as Choice1email asc, Choice2email asc, Choice3email asc I get an invalid expression error. Choice1email, Choice2email, Choice3email are values from the trigger item.

 

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (7,373)