Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How can I fetch the list views columns in Salesforce?

    Tagged: List View, List View Column, Metadata API, Salesforce Apex, Salesforce SOQL

    • Salesforce® Discussions

      How can I fetch the list views columns in Salesforce?

      Posted by Naman on April 30, 2016 at 6:07 PM

      I want to fetch the list views columns in salesforce. Please tell how to do this.

      Ajay Prakash replied 7 years, 11 months ago 3 Members · 2 Replies
      • List View
      • List View Column
      • Metadata API
      • Salesforce Apex
      • Salesforce SOQL
    • 2 Replies
    • Surbhi

      Member
      June 9, 2016 at 1:16 PM

      Hi Naman,

      This can be done using Metadata API.

      Thanks

    • Ajay Prakash

      Member
      February 12, 2018 at 2:34 PM

      We can retrieve list view column or the records based on the list view id using HTTP request. The response contains the query string that contains columns of the list view.  Below code is for reference –

      public static List<Account> getFilteredAccounts(String filterId){
          HttpRequest req = new HttpRequest();
          String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
          String endPoinURL = baseUrl+’/services/data/v32.0/sobjects/Account/listviews/’+filterId+’/describe’;
          req.setEndpoint(endPoinURL);
          req.setMethod(‘GET’);
          req.setHeader(‘Authorization’, ‘Bearer ‘ + UserInfo.getSessionId());
          Http http = new Http();
          HTTPResponse response = http.send(req);
          Map<String, Object> tokenResponse = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
          String query = (String) tokenResponse.get(‘query’);
          List<Account> AccountList = new List<Account>();
          for(Account accountObj : database.query(query)){
              AccountList.add(accountObj);
          }
          return AccountList;
      }

      In the above example, I have retrieved accounts based on the selected list view.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Salesforce Data Cleansing Best Practices That you Should Consider Implementing Now

    Blog in Data, Salesforce

    Salesforce is a powerful tool that can help your business grow, but it can only reach its full potential when it’s populated with good quality…

    Bad Quality Data, Best Practices, Business, Business Laders, Classic Experience
    pogrebs Jun 5, 2020
    12,835  Views
    A Detailed Guide to Salesforce RPA Integration in 2023

    A Detailed Guide to Salesforce RPA Integration in 2023

    Blog in Salesforce

    Salesforce is one of the most popular CRM software in the world. There are a lot of benefits to using Salesforce, but one of the…

    Apex Triggers, Bulk Triggers, Creating Triggers, Insurance, Insurance Agents
    SP Jan 30, 2023
    1,993  Views
    Custom MetaData Types

    All About Custom MetaData Types | The Salesforce Developer Guide

    Blog in Data, Others, Salesforce

    Custom metadata is packageable, adjustable, upgradeable, and deployable application metadata. To start with, you make a custom metadata type, which characterizes the type of application…

    Application Metadata, CSV File, Custom Fields, Custom Fields Values, Custom Metadata
    krati vishnoi Dec 24, 2020
    3,790  Views

    Popular Salesforce Videos

    Use Case Hierarchy to Link Cases in Salesforce

    Use Case Hierarchy to Link Cases in Salesforce

    Video in Salesforce Stories

    Want to link your cases, so you and your team have a complete view of what’s going on with a customer? Do you want to…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Service Cloud
    Abhishek Mar 7, 2022
    2,818  Views
    Contact Deletion in Salesforce Marketing Cloud

    Contact Deletion in Salesforce Marketing Cloud

    Video in Marketing

    Cameron Robert from Datarati talks through how the Contact Delete function works, how to use it, and a practical demo of how to build a…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Marketing Cloud, REST API
    Cameron Sep 5, 2025
    3,451  Views
    Top 6 Products by Salesforce Marketing Cloud

    Top 6 Products by Salesforce Marketing Cloud

    Video in Marketing, Salesforce Cloud Platform

    Salesforce is largely regarded as the most influential Salesforce automation and cloud CRM vendor, having popularized the SaaS model and, in the process, disrupted the…

    salesforce, Salesforce Marketing Cloud, Salesforce Automation, Salesforce Video, Cloud CRM Vendor
    Algoworks Feb 4, 2021
    1,615  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.