I want to get all the list column names in alert using the Ajax. Any help on this will be appreciated.


2 Answers 2


You can achieve this using following REST URL --

https://abcd.sharepoint.com/sites/RohitW/_api/web/lists/getbytitle('TestList')/Fields?$filter=Hidden eq false and ReadOnlyField eq false

Below is the full code :

var url = "/_api/web/lists/getbytitle('TestList')/Fields?$filter=Hidden eq false and ReadOnlyField eq false";

getFields(url).then(getFieldsSuccess, getFieldsFail);

function getFields(url){
    return $.ajax({
        url: _spPageContextInfo.webAbsoluteUrl + url,
        type: "GET",
        headers: {
            "accept": "application/json;odata=verbose",

function getFieldsSuccess(data){
    $.each(data.d.results, function(K, V){

function getFieldsFail(err){
    // error callback

You can use SharePointPlus JavaScript library. Easy to use and really good.

Here is an example how to get field information at list.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.