none
SharePoint Online 2013 - Fetch managed metadata column value using jQuery not working for any user other than site administrators

    Question

  • Hi,

    I am fetching values from a managed metadata column from a list in jQuery using REST API. I had referred following article:

    TAXONOMY COLUMNS & SHAREPOINT 2013 LIST REST API

    I have used CAML query to fetch the taxonomy field and displayingTerm label on my page. When a site administrator or owner accesses the page, he can see the Term label but for other users a null value is displayed for the Term label.

    Can anyone please tell me how to fix this issue?

    Thanks,

    Shruti


    Regards, Shruti

    Saturday, March 18, 2017 11:16 AM

All replies

  • Hi,

    I tested with read permission user account and I can get the managed metadata field successfully, make sure your user has read permission(at least) for your list.

     <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
        <script type="text/javascript">
            $.ajax({
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/Lists/GetByTitle('myList2')/GetItems(query=@v1)?@v1={'ViewXml':'<View><Query/></View>'}",
                type: "POST",
                headers: {
                    "Accept": "application/json;odata=verbose",
                    "X-RequestDigest": $("#__REQUESTDIGEST").val()
                },
    
                success: function (data, textStatus, jqXHR) {
                    console.log(data.d.results[0].Product.Label);
                },
    
                error: function (jqXHR, textStatus, errorThrown) {
                    console.dir(jqXHR);
                }
            });
        </script>

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, March 20, 2017 5:57 AM