Power Automate + SharePoint list - Compose/Get Item operation error

Viewed 833

I am currently struggling with a flow almost identical to this one: https://powerusers.microsoft.com/t5/Building-Flows/Find-Lowest-number-in-list-column-and-use-to-sort-items/td-p/777718

My flow fails at the last Get Item operation with following error:

Error
Action 'Get_item' failed

Unable to process template language expressions in action 'Get_item' inputs at line '0' and column '0': 'The template language expression 'outputs('Get_items_2')?['body/value'][outputs('Compose')]['ID']' cannot be evaluated because property '{
  "value": [
    {
      "@odata.etag": "\"4\"",
      "ItemInternalId": "3",
      "ID": 3,
      "Title": "Name Surname",
      "Counter": 11.0, [...]

most of this part of the property info had to be redacted

[...] cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

My flow:

enter image description here

enter image description here

enter image description here

enter image description here

Basically I need to extract this ID (in this case its equal 3) as ID for Get Item and I'm done. I just can't get passed this last line without any errors.

Any advice highly appreciated!

1 Answers

I hope this helps. Using this list ...

List

... with this VERY basic concept and expression ...

Flow

... it produces the expected result.

Result

Bottom line, I don't think you need the Compose action, simply query the Get items result set using the following expression ...

first(body('Get_items')?['value'])['id']

Given you only want 1 record back from the Get items call, the above seems to be the easiest way to achieve what you want.

You may need to perform some error checking if Get items returns nothing though.

Related