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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Lookup GUID not being ...
Power Automate
Answered

Lookup GUID not being retrieved from Related Table

(0) ShareShare
ReportReport
Posted on by 13

First time posting so if I'm doing something incorrectly please have patience.

 

We have created a new Lookup field that is on the Opportunity and I need to populate with a value this is a related table.  We need to run a flow to update all the opportunities with the new lookup value.  I am able to get the correct list and can expand the values in the related entity but whenever I try to access the GUID, it returns as empty.

I have tried many different ways to access the guid but I can't seem to get the GUID so I can update the new field.  Can someone see what I'm doing wrong?

 

The code of my List action is:

{
    "inputs": {
        "host": {
            "connectionName""shared_commondataserviceforapps",
            "operationId""ListRecords",
            "apiId""/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
        },
        "parameters": {
            "entityName""opportunities",
            "$select""name",
            "$filter""customentity1 ne null",
            "$expand""New_Lookupfield($select=new_name, cdx_Project)",
            "$top": 2
        },
        "authentication": {
            "type""Raw",
            "value""@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"
        }
    },
    "runtimeConfiguration": {
        "paginationPolicy": {
            "minimumItemCount"10000
        }
    }
}

 

When I try to load the results into an HTML table, I can see the name (string) from the related table but the GUID (called cdx_Project) is blank.  Here is the peek code from the HTML to show the syntax I'm using.

The code for the HTML table showing how I am referencing the ID is:

        "columns": [
            {
                "header""Opportunity",
                "value""@item()?['name']"
            },
            {
                "header""new_Name",
                "value""@item()?['New_Lookupfield/new_name']"
            },
            {
                "header""cdx_Project",
                "value""@item()?['New_Lookupfield/cdx_Project']"
            }
        ]
    }
}
 

 

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @afbrewin 

    can you share your flow steps ? and explain more which GUID is returning Empty?

     

  • afbrewin Profile Picture
    13 on at

    Here is a screenshot.  It doesn't get much simpler than this!

    afbrewin_0-1621814171002.png

     

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @afbrewin 

    To get the fields from the Expand Query , you need to use Parse JSON, Can you run the Flow and paste the output from the step Opps with no Master Vehicle.

     

  • Verified answer
    afbrewin Profile Picture
    13 on at

    Thanks for the help @Mira_Ghaly   The Parse JSON producted the same results but I was able work out the problem.

    It turns out the to get the ID in a form that is usable, you need to retrieve it from the child table.  Therefore a nested $expand is needed.  The expand clause needs to be:

    New_LookupValue($select=new_name;$expand=cdx_Project($select=new_projectid))

     

    I can reference it with the item() expression as:

    item()?['New_LookupValue/cdx_Project/new_projectid']
    but the GUID field must be in the $select=.
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard