Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get all internal field names using JavaScript
async function GetFields(listTitle){
let data = await fetch(`${_spPageContextInfo.siteServerRelativeUrl}/_api/web/lists/GetByTitle('Users')/Fields?$filter=Hidden%20eq%20false`,
headers: {"Accept":"application/json;odata=verbose"}
let fields = await data.json();
console.log(>`${field.Title} | ${field.InternalName}\n\r`).join("") );
// pass the list name:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.