web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Problem using the firs...
Power Automate
Unanswered

Problem using the first result from List Records

(0) ShareShare
ReportReport
Posted on by 2

I have leads coming in containing text names for countries from a web form that uses something akin to an option set, the lead arrives with the country name filled in a text column. In Lead, we use a custom table for country for reporting purposes and have a country lookup column to show it on the Lead form.

 

I want a flow to read the text name, look up the name column in the country table, then update the lead country look up column with the matched country.

 

I have set up a trigger which correctly pulls the effected lead when it is created (or updated). 

I have a List Row  action which allows me to search and find the country using the text column from the trigger.

I have set the Top Row to 1, it is correctly pulling one country row when I test.

 

I then am trying to update the original lead row, I know the preceding List Row action will create an Apply to All if I just select the GUID dynamically even though I limited the action to just one item to return. I have read elsewhere that the right process is to use a "first" expression to update my lookup field when updating the lead record. But I keep getting errors, the other examples of expressions I have seen here don't work. Can anyone help?

 

My country table GUID column name is c9_countryid

 

Here is my flow and the expression I can't fathom!

 

 
 

image.png

image.png

The first two actions pull data correctly,

The third action is updating the right row, I tested by adding some text to the notes fields and the whole flow reacts as expected and updates the original lead row.

My challenge is extracting the country GUID from the List Row action and then updating it in the third action.

 

To update the look up field in the Lead, I have this expression

 

first(outputs('List_country')?['body/c9_countryid'])

 

'List_country' is my second action.

c9_countryid is my primary ID for the country table.

 

When I view the failed run i get this error message which suggest the expression is not right for the file type?

 

Error Message:

image.png

 

image.png

 

Can anyone suggest what is the correct expression to use please?

 

 

Categories:
I have the same question (0)
  • JimA Profile Picture
    2 on at

    I should have added, the last visual is cut from the raw data in the test, I wanted to show that the 2nd action is correctly pulling the GUID, I just can't then use it in the third action 😞

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @jimal 

     

    Can you try outputs('List_country')?['body']?[0]?['c9_countryid']

     

    Damien

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard