Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Answered

Portal -Execute Dynaics 365 FetchXML from entityform

(0) ShareShare
ReportReport
Posted on by 120

Hi,

 

We are trying to resolve a hopefully simple problem. We need pass the login user id to retrieve another entity record in CRM/CDS and set that as a lookup on the entityform on the load.

 

I wonder if somebody could share an example where Dynamics 365 retrieve operation is done perhaps via FetchXML in the entityform javascript and result parsed therefore lookup value set on the form?

 

Thanks

  • EmployeeOcta Profile Picture
    on at
    Re: Portal -Execute Dynaics 365 FetchXML from entityform

    Hi OOSYLYN,

    As per the article it's rendering as dropdown , but my query here i need to select the default value in the lookup field, which is not in this case.

     

    is there any possibility we can by default choose that.

  • UmerJaved Profile Picture
    120 on at
    Re: Portal -Execute Dynaics 365 FetchXML from entityform

    Thanks @OOlashyn . I'll try the link/article you suggested and come back if any questions.

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Portal -Execute Dynaics 365 FetchXML from entityform

    yes, but you need the current logged in user id to retrieve the additional records, isn't that your requirement?

    to get the id you use the liquid object I mentioned earlier

     

    then you can use that ID in your Fetch / oData

  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on at
    Re: Portal -Execute Dynaics 365 FetchXML from entityform

    Hi @UmerJaved ,

     

    I wrote an article on how to dynamically filter and set data to lookup fields. Check it out - I think this approach will help you.

  • UmerJaved Profile Picture
    120 on at
    Re: Portal -Execute Dynaics 365 FetchXML from entityform

    Hi @OliverRodrigues 

     

    As mentioned we are not trying to retrieve login user id, instead we are using that id to retrieve another entity record which needs to be setup as lookup on the current entityform on load.

    Hence my question as how we can make such call from custom JavaScript(FetchXML/ODATA?) to retrieve related entity and set that as lookup on entityform?

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Portal -Execute Dynaics 365 FetchXML from entityform

    Hi

     

    you don't need to perform a retrieve to get the current's user id, there is a Liquid object that you can get it very easy: {{ user.id }}

     

    to set lookup value via JS you can refer to the following:

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/262869/setting-value-on-lookup-field-using-javascript-in-crm-portals

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35