Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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 8 years, 8 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

    • [adinserter block='9']
    • 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

    Popular Salesforce Blogs

    What are the Apex Best Practices in 2023?

    What are the Apex Best Practices in 2023?

    Blog in Others

    Salesforce is one of the most well-known and effective cloud-based CRM systems. To obtain additional workflow or configuration, you may need to change the development…

    API Bulk Updates, API Call, Batch, Batch Apex, Batch Apex Class
    ashutosh pandey Jan 11, 2023
    2,057  Views

    Event Management in Salesforce in 2024

    Blog in Others

    How to Build a Robust Event Management System on Salesforce?  Organizing events is a strategic business initiative with multifaceted benefits. From expanding professional networks to…

    AppExchange, Application Events, Automation, Brand Credibility, Brand Expertise
    Advanced Feb 21, 2024
    1,349  Views
    What is the Salesforce Guidance Center in 2023? | The Trailhead Guide

    What is the Salesforce Guidance Center in 2023? | The Trailhead Guide

    Blog in Others

    The Guidance Center is a one-stop shop for learning and enablement in the flow of work. Learning is both recommended to users automatically by Salesforce…

    Apple, Badges, Badges on Trailhead, Best Practices, Business
    Stimulus Consulting Mar 10, 2023
    2,666  Views

    Popular Salesforce Videos

    GDPR & Telephony Consenting & Forgetting In Salesforce

    GDPR & Telephony Consenting & Forgetting In Salesforce

    Video in Others, Sales

    The big noise in the market right now is GDPR, the General Data Protection Regulation. This is the new European rule for data protection which…

    salesforce, CRM, CTI, phone, telephone
    Ian Mar 20, 2020
    2,347  Views
    How To Assign Leads in Salesforce | Overview of 3 Main Lead Routing Solutions

    How To Assign Leads in Salesforce | Overview of 3 Main Lead Routing Solutions

    Video in Salesforce Development

    Salesforce offers several options on how to automatically assign incoming leads to a suitable sales manager. But what to choose: out-of-the-box features, external AppExchange app,…

    Lead Assignment rule in Salesforce, Salesforce Lead Assignment Rule, Salesforce Custom Development, Lead Assignment Rule, Lead Routing
    ENWAY Jul 3, 2024
    1,149  Views
    Spring'21 Prior Value in Salesforce Record Triggered Flows - ISCHANGED IN Salesforce Flows

    Spring'21 Prior Value in Salesforce Record Triggered Flows - ISCHANGED IN Salesforce Flows

    Video in Salesforce Admin

    In this video, I'm talking about the Prior value feature in the Spring'21 pre-release that is for the record triggered flow.  Pre-Release Org URL: https://www.salesforce.com/form/signup/prerelease-spring21/…

    Salesforce Training, salesforce, Salesforce VIdeos, salesforce record, Salesforce Learning
    Shubham Jan 14, 2021
    2,791  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.