power-automatedataversepower-platformpowerapps-modeldrivenmodel-driven

How does Microsoft Entra ID works with LookUps? Not able to get the original user ID for getting mail address in Dataverse


I have a Dataverse column with a lookup on Microsoft Entra ID. The user selects a person from the look up.

Now, I have a dataverse connector monitoring the changes to the Dataverse table. When a new row is added, I need to get the 'Requesting For' field. Now, I can see the field in the JSON format and the ID provided is not my ID.

I can see in the created by field that my ID ends with 6045bd15a5b4 but in the requesting for, which I set to myself, the value is totally different. How do I get the value that is it me?

        "_new_businessunitrequestedfor_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "new_BusinessUnitRequestedFor",
    "_new_businessunitrequestedfor_value@Microsoft.Dynamics.CRM.lookuplogicalname": "new_abcd",
    "_new_businessunitrequestedfor_value@odata.type": "#Guid",
    "_new_businessunitrequestedfor_value": "096b0df9-6045bd6944fe",

The value, which I have edited, is not my value as seen from the other fields.


Solution

  • So, I have figured this out.

    When a field has a lookup with the Entra ID, you can simply pass the ID to the Outlook connector and get the details of the users.

    When you create, modify or own a field, the value is taken from 'system users' table and will be shown as 'systemuser'. This ID cannot be passed to the Outlook connector. In order to get the details of this user, you will have to add a filter to your Power Automate connector.

    For example, if you are trying to get the Created By field, you need to use the below:

    createdby($select=internalemailaddress, fullname)
    

    Expand Query filter to be applied on the power automate dateverse connector

    This will return back a JSON in the response with the email ID and the name of the person as seen below (original data has been removed):

      "createdby": {
    "@odata.type": "#Microsoft.Dynamics.CRM.systemuser",
    "@odata.id": "https://aics.com/api/data/v9.1/systemusers(bef90143da6)",
    "@odata.etag": "W/\"6977955\"",
    "@odata.editLink": "systemusers(bef3da6)",
    "internalemailaddress": "",
    "fullname": "",
    "systemuserid@odata.type": "#Guid",
    "systemuserid": "bef90f88-ed45bd143da6",
    "ownerid@odata.type": "#Guid",
    "ownerid": "bef903da6"
    

    }