locked
SharePoint Hosted Add In REST API returns null for lookup field values RRS feed

  • Question

  • I have written following REST Query in SharePoint Hosted Add In to get list items:

    <appweburl>/_api/SP.AppContextSite(@target)/web/lists/getbytitle('PageAccessMatrix')/items?$select=Headers,GranitePageLink/PageLink,PageName/Title&$expand=GranitePageLink,PageName&$filter=InsideNavigation%20eq%201&@target=%27<hostweburl>%27

    However, everything is working fine in development and production environments and after I restored the database of production to make UAT environment, the same above query is returning null value of lookup fields (i.e. GranitePageLink and PageName) for non-farm account users accessing the SharePoint Hosted Add In.

    If I run the same REST query outside the context of SP Hosted Add In then it works fine for all users in UAT environment.

    Following troubleshooting I have performed:

    1. Lookup fields having proper data in list
    2. Checked the lookup fields relation in list - OK
    3. Created new lookup fields - still returns null

    On Premise Environment-

    SharePoint Server: 2019

    Any help would be much appreciated!

    Tuesday, July 14, 2020 4:32 PM

All replies

  • Hi suhailShaikh,

    This issue requires a specific environment, we may not able to comment it a lot. Generally it's not recommended to modify the DB, if possible you have a try to reverse it to old version. Or try to test it on another list. If it not works, we'd like to suggest you raise this issue on SP support.

    This “SharePoint Server 2013” Forum will be migrating to a new home on Microsoft Q&A, please refer to this sticky post for more details.

    Best Regards,

    Baker Kong


    "SharePoint" forums will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "SharePoint" forums' new home on Microsoft Q&A !


    Wednesday, July 15, 2020 6:43 AM
  • Hi Baker_Kong,

    Configuration Database version had been same for both production and UAT environments.

    I have also tried creating new site and app catalog, still facing same issue. 

    Same issue persist if trying to query using JSOM as well. 

    Wednesday, July 15, 2020 6:50 AM