PowerApps Web Api fetch LookUp field from table

691 Views Asked by At

Is there a way to fetch the lookup field value when using the the Web Api and Ajax? Currently, I am trying to use the same method as for regular table fields, but it does not work. Can't find anything in the documentation.

1

There are 1 best solutions below

0
On

To retrieve related the field in an N:1 relationship through the Web API, specify the field in the select query with the following format _{entity logical name}_value" like _c881b_tool_value where cr88b_tool is the entity logical name. Also, make sure permissions are set accordingly to microsoft documentation for the related entity.

    function loadRecords() {
        return appAjax('Loading...', {
            type: "GET",
            url: "/_api/cr88b_tooltests?$select=cr88b_name,cr88b_torque,cr88b_torquetoolserialno,_cr88b_tool_value",
            contentType: "application/json"
        });
    }