cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Amatrox
Resolver I
Resolver I

get specific value from sharepoint list

Hi all,

 

I am new to Power Automate and trying to get a specific value from a sharepoint list and increment a variable. The list looks like this:

rating.png

 

 

 

The flow should increment a variable. E.g. If a condition is true it should use the value of "Rating" from "ID" 1 and it it´s false it should use the value of "Rating" from "ID" 2.

 

condition.png

 

 

I got a solution by writing the values in a array and use "variables('Rating')[5]" to get the value of index 5 equal to "ID" 5 from the list.

 

Array solution.png

 

 

But I guess there is an easier way with just one expression like "get value "Rating" where "ID" == 1" ?

 

Best Regards,

André

1 ACCEPTED SOLUTION

Accepted Solutions

I'm not 100% sure I understand the question. But I think you want something like this:

2021-01-28_11-34-36.jpg

The select creates your array without the need for a variable and to loop through the items and produces output like this:

[
  {
    "ID": 1,
    "Rating": 1
  },
  {
    "ID": 2,
    "Rating": 2
  },
  {
    "ID": 3,
    "Rating": 3
  }
]

The filter then filters the output of the select, to just the ID you are interested in.

The compose step at the bottom outputs the rating, from the only expected result.

 

The select action will continue to contain the entire array of results so you can perform multiple filters on it if you are looking for different IDs.

View solution in original post

4 REPLIES 4
PrasadAthalye
Super User
Super User

@Amatrox -

 

If you would like to filter List Item for a given id, you can use GetItem Action. See below.

PrasadAthalye_0-1611442561130.png

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

@PrasadAthalye -

 

thanks for your reply! I know this function but the problem is, that I have to choose the value due to an answer from a form. So I dont want to use "Get item" for every decission that the flow has to go through

I'm not 100% sure I understand the question. But I think you want something like this:

2021-01-28_11-34-36.jpg

The select creates your array without the need for a variable and to loop through the items and produces output like this:

[
  {
    "ID": 1,
    "Rating": 1
  },
  {
    "ID": 2,
    "Rating": 2
  },
  {
    "ID": 3,
    "Rating": 3
  }
]

The filter then filters the output of the select, to just the ID you are interested in.

The compose step at the bottom outputs the rating, from the only expected result.

 

The select action will continue to contain the entire array of results so you can perform multiple filters on it if you are looking for different IDs.

View solution in original post

@Paulie78 -

 

that´s what I was looking for! Not as short as I expected but I can live with that.
Thank you!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,446)