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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Xrm.WebApi retrieveRec...
Power Apps
Unanswered

Xrm.WebApi retrieveRecord/retrieveMultipleRecords returns null for a lookup value

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a strange behaviour doing a web api call to get lookup value of an entity.

It works with a system admin, but doesn't return lookup value for a user with a security role with Organization access to the entities it is querying.

 

As you see I've built 2 calls, to test if second call work, despite first one works for the sys admin user, 

I've make sure user has Organization permissions to Resource and bank holiday jurisdiction, but it always return null.

Is there anything else related to permission I should check?

 

Xrm.WebApi.retrieveMultipleRecords("bookableresource", "?$select=name,_new_bankholidayjurisdiction_value&$expand=new_BankHolidayJurisdiction($select=new_name)&$filter=_userid_value eq " + userID).then(
			function success(resultQuery) 
			{
				if(resultQuery.entities.length == 0)
				{
					return;
				}
				else
				{
					var resultResource = resultQuery.entities[0].bookableresourceid; 
					
					Xrm.WebApi.retrieveRecord("bookableresource", resultResource, "?$select=_new_bankholidayjurisdiction_value").then(
					function success(resultFP) {						
						var payee = resultFP._new_bankholidayjurisdiction_value
						
					},
						function (error) {
						console.log(error.message);
						// handle error conditions
					}
					
					);

 

Jorge_0-1713974729730.pngJorge_1-1713974799952.png

 

 

system Admin call

Jorge_2-1713974901522.png

 

I have the same question (0)
  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at

    you are running two different query, due to this condition:
    &$filter=_userid_value eq " + userID
    are you sure that the bookable resource record you are checking (the one with the ID starting with db7... has the lookup new_bankholidayjurisdiction filled with a value?
    because the other screenshot (the one you run with sysadmin) it shows a different record (starting with ID 7f35) due to how the first query is structured.

  • Jorge_ Profile Picture
    on at

    Hi Guido, thanks for the reply

    Yes it has a value..

     

    Jorge_1-1713976019268.png

     

     

  • Verified answer
    Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at

    the field has a key icon beside the name, it means it is protected by Column Security

    you need to create a security profile (in addition to the security role the user has already) with the read permission on that field and assign it to the user so it can read the value (by the form or by web api)

  • Jorge_ Profile Picture
    on at

    Thanks so much Guido! I couldn't understand why it didn't work!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard