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, 9 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 Einstein Analytics - a brief overview and comparison with SAP Analytics Tools and Microsoft Power BI

    Blog in Salesforce Einstein

    What is Einstein Analytics and how it will support for your business to reach to the next level? Normally the people who are controlling the…

    App Cloud, Business Success, Customer Satisfaction, Customer Service, Einstein
    Prasad Dec 3, 2018
    8,938  Views
    salesforce chatter

    How to Use Salesforce Chatter Better?

    Blog in Others, Salesforce Products

    Here are 3 main STEPS, by which you can use SALESFORCE chatter more efficiently. Take a look… STEP 1: Follow relevant people and data Keep…

    Business Associates, Business Deal, Cases and Custom Objects, Chatter Administrators, Chatter Email Manager
    Algoworks Jan 16, 2017
    9,890  Views

    Hiring the Best Salesforce Consultants: What to Look for?

    Blog in Salesforce Consultant

    Today's businesses constantly seek innovative ways to streamline operations and improve customer service. Salesforce is a leading CRM (customer relationship management) platform in the market…

    Business Challenges, Business Requirements, Business Success, Change Management, Communication Skills
    Larry May 28, 2024
    485  Views

    Popular Salesforce Videos

    Creating a Roll-up Using DLRS | Salesforce Tutorial Video

    Creating a Roll-up Using DLRS | Salesforce Tutorial Video

    Video in Salesforce Admin

    In certain situations, an object does not support a roll-up or the relation is not permitted. Learn how to make it possible by using the…

    Salesforce Training, Salesforce Tutorial, Salesforce Video, Salesforce Learning, Salesforce Tutorial Video
    SkyPlanner Aug 12, 2021
    2,461  Views
    What All Industries Are Covered By Salesforce Industries?

    What All Industries Are Covered By Salesforce Industries?

    Video in Salesforce Stories, Salesforce Cloud Platform

    Salesforce Industries offers a collection of 12 industry clouds that are suited to the best practices for these sectors. Salesforce Industries aids businesses in navigating…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Webinar, Salesforce clouds
    Cyntexa Sep 20, 2022
    1,404  Views
    Service Resources and Territories in Salesforce | Salesforce Webinar

    Service Resources and Territories in Salesforce | Salesforce Webinar

    Video in Salesforce Field Service Platform

    Ensure seamless field service operations by setting up Service Resources and Territories in Salesforce Field Service the right way. Organize and manage field service operations…

    Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Field Service Platform, Salesforce Field Service
    AblyPro Jun 26, 2024
    712  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

    © 2025 - 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.