Skip to main content

Notifications

Microsoft Dynamics CRM forum
Answered

Locating the Record ID or GUID for a lookup field that is within CRM

Posted on by 75

**Background:**

I have been working on this the past day and will appreciate any insight. I am creating a Logic App that automates the transfer of data from CosmosDB to CRM. My dilemma is that in creating my logic app, the fields are a 'lookup' field. I am unsure of where to find the guids for these lookup fields.

This is what I have done so far:

pastedimage1596577760806v2.png

pastedimage1596577803992v3.png


**Dilemma:**

I am trying to find the record ID or GUID for the 'Feature Category' lookup field. How exactly do I do this? I researched where someone mentions to search within CosmosDB,how would I do this?

There are other articles that state you have to List Records' within the Logic App? However, I am not fully understanding this.

Any insight is greatly appreciated.

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Locating the Record ID or GUID for a lookup field that is within CRM

    Hi,

    I can see in your image. Check below I have highlighted in red color.

    CQ65.PNG

    Also, for my text values, you are saying that in order for me to return the GUID, I would have to perform the operation for every distinct text. Is there an efficient way to even do this?

    You can create new text field(Single line of text) and directly map the data from cosmos to this newly created field. This does not require lookup as this is text field. Now ask CRM developer to fill the lookup field based on text value using plugin.

    If found helpful, Please mark my answer verified.

  • jasmine202020 Profile Picture
    jasmine202020 75 on at
    RE: Locating the Record ID or GUID for a lookup field that is within CRM

    Thank you @Bipin

    So I am using this:, a sandbox environment. Where can I find all of your screenshots? Can I find this within my sandbox?

    pastedimage1596601847371v1.png

    Also, for my text values, you are saying that in order for me to return the GUID, I would have to perform the operation for every distinct text. Is there an efficient way to even do this?

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Locating the Record ID or GUID for a lookup field that is within CRM

    Hi,

    Does this mean that the CRM does not have the ID for this lookup?

    Yes, This means we don't have any record in CRM with the filter criteria specified.

    also, for this text field, below, there are over 3000 distinct texts, similar to the ASME: Azure stack. Does this mean I have to perform the list record for every single text?

    Every time when you are creating record in Dynamics CRM, you would required GUID so yes you will have to perform this operation.

    Also, where do I find the name for the search query? for example for the Features Category, I guessed at ems_name. But how do I know this for sure?

    Can you go to advanced find see below image highlighted section in red color to open Advanced find from CRM dynamics Home page

    CQ63.PNG

    Once advanced find open, select feature category in look for then click on result to see how many records are already present in crm for this entity. Once you find the records check the column which has same name as the value which you are getting from cosmos. Now go back and add filter condition on same field then click on download fetxh xml.

    CQ64.PNG

    Replace Account with feature category - then click result see highlighted section in red color

    once you get records, check field to be used and go back then add filter same as account name

    If found helpful, Please mark my answer verified.

  • jasmine202020 Profile Picture
    jasmine202020 75 on at
    RE: Locating the Record ID or GUID for a lookup field that is within CRM

    Ok @Bipin   you so much. A few questions I have

    I went ahead and did this to locate my GUID. The logicApp ran well but the output is [] an empty array (see below)

    pastedimage1596598135414v1.png:

    pastedimage1596598220280v2.png

    Does this mean that the CRM does not have the ID for this lookup?

    also, for this text field, below, there are over 3000 distinct texts, similar to the ASME: Azure stack. Does this mean I have to perform the list record for every single text?

    pastedimage1596598337091v3.png

    Also, where do I find the name for the search query? for example for the Features Category, I guessed at ems_name. But how do I know this for sure?

    Finally, once I located the GUID, how do I place this in the logic app?

    pastedimage1596598473991v4.png

    Thank you Bipin!

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Locating the Record ID or GUID for a lookup field that is within CRM

    Hi,

    Did you follow my answer which I suggested on your other forum question?

    If not please see below my answer.

    1. First Check if value for feature category which you are getting from cosmos DB is present in crm. To check this you can use Advanced find in Dynamics CRM and look for feature category then add filter Name equals Value you are getting from Cosmos DB. click on result, If value is present in crm as suggested use list records to get record ID. If value is not present then ask your project lead how do we handle this?

    2. If value is not present in CRM, Ask you project lead this question - "Do we need to create feature category record first and then use newly created record ID to set the lookup field on feature"

    I don't think this filter criteria and entity name is correct.

    Navigate to settings->Customization->Customize the system->Entity>Feature->Fields->Open Feature group fields->Check Target Record Type

    7801.CQ62.PNG

    Now go back to list record in logic apps change the entity name to same as Target record type in field property.

    For filter criteria you should install below rest builder solution on your crm instance/you can also use fetchxml builder from xrm toolbox to build the filter criteria syntax.

    github.com/.../releases

    Download managed solution and install in your crm instance.

    build the filter criteria in rest builder and copy same in logic apps

    I think your filter criteria should be new_name eq 'Azure Stack' --Replace new_ with your prefix

    If found helpful, Please mark my answer verified.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans