{"id":5602,"date":"2020-06-24T08:30:46","date_gmt":"2020-06-24T08:30:46","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/salesforce\/?p=5602"},"modified":"2020-06-24T08:30:52","modified_gmt":"2020-06-24T08:30:52","slug":"salesforce-tips-discover-the-api-metadata-for-salesforce-reports","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2020\/06\/24\/salesforce-tips-discover-the-api-metadata-for-salesforce-reports\/","title":{"rendered":"Salesforce Tips &#8211; Discover the API Metadata for Salesforce Reports"},"content":{"rendered":"\n<p>This blog signifies how a user can find the API metadata for a particular report. <em>Before going through this blog make sure you have a keen understanding of reports, workbench and can understand sample apex code.<\/em><\/p>\n\n\n\n<p>User will generally use this method to find the API name for the field attribute in <strong><em>&lt;analytics:reportChart><\/em><\/strong>. Using the Analytics API user can access Report Metadata.<\/p>\n\n\n\n<p>Kindly follow the below steps to get the metadata for the report: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Open Salesforce workbench (<a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/workbench.developerforce.com\/\" target=\"_blank\">https:\/\/workbench.developerforce.com\/<\/a>)<\/li><li>Select your Salesforce (Sandbox or Production) Environment and API version to login to your Salesforce credentials.<\/li><li> In workbench under the \u201cUtilities\u201d tab click on \u201cREST Explorer\u201d <\/li><li>Copy the URL: \u201c<strong>\/services\/data\/v29.0\/analytics\/reports\/YourReportID\/describe<\/strong>\u201d and paste it in the Execute box. <\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><em><strong>Note:<\/strong> Paste the Report ID of your Report and replace it with <strong>YourReportID <\/strong>from the URL <\/em><\/p><\/blockquote>\n\n\n\n<ul class=\"wp-block-list\"><li>To identify <strong><em>YourReportID<\/em><\/strong>, go to the reports tab. Open your report, and copy the text as shown in the below image<\/li><\/ul>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2020\/06\/1_Report-ID.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2020\/06\/1_Report-ID.jpg\" alt=\"Report ID\"><\/a><\/center>\n<font size=\"2\"><center><i>Report ID<\/i><\/center><\/font>\n\n\n\n<ul class=\"wp-block-list\"><li>Execute the URL and you will see responses for the particular Report and click on the ReportMetadata.<\/li><li>In the expanded view of the module, search for ReportFilters. And you will see the number of parameters that have been set for the report. <\/li><\/ul>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2020\/06\/2_reportFilters.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2020\/06\/2_reportFilters.jpg\" alt=\"Report Filters\"><\/a><\/center>\n<font size=\"2\"><center><i>Report Filters<\/i><\/center><\/font>\n\n\n\n<ul class=\"wp-block-list\"><li>Now we can use pass the filter value of the report dynamically through Apex class as shown in the below apexcode: <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;analytics:reportChart reportId=\"00O3D000000bsojUAA\" filter=\"&#91;{column:'FK_ACC_ID', operator:'equals', value:'DynamicallyAssignedValue'}]\" size=\"medium\" cacheResults=\"false\"\/><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>Where,<br><strong><span style=\"text-decoration: underline;\">Column:<\/span><\/strong> The API name of the field that you want to filter on.<br><strong><span style=\"text-decoration: underline;\">Operator:<\/span><\/strong> The API name of the condition you want to filter a field by, for example to filter by \u201cnot equal to\u201d, we can use API name \u201cnotEqual\u201d<br><strong><span style=\"text-decoration: underline;\">Value:<\/span><\/strong> The filter criteria.<\/em><\/pre>\n\n\n\n<p><em>For more information, you can refer the below link: <a href=\"https:\/\/help.salesforce.com\/articleView?id=000315117&amp;language=en_US&amp;type=1&amp;mode=1\" target=\"_blank\" rel=\"noopener\">Use Metadata API to retrieve and deploy using Workbench<\/a><\/em><\/p>\n\n\n\n<p>We hope you may find this Blog resourceful and helpful. If you still have concerns or need more help, please contact us on <a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a><\/p>\n\n\n\n<p style=\"text-align: justify\"><b>About Us<\/b><\/br>\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> \u2013 a globally recognized and one of the oldest Sage Development Partner and a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners and Sage PSG across the globe. We offer Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that require apex code incorporation into the Salesforce platform.<br><br> Greytrix has some unique solutions for Cloud CRM such as <a href=\"\">Salesforce Sage integration<\/a> for <a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/integration\/\">Sage X3<\/a>, <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/sage-100-integration\/\">Sage 100<\/a> and <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/sage-300-integration\/\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/crm-development\/\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/data-migration-support\/\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/crm-development\/\">Integrated App development<\/a>, Custom App development and Technical Support business partners and end users. Salesforce Cloud CRM integration offered by Greytrix works with Lightning web components and supports standard opportunity workflow. Greytrix GUMU&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star rated app listed on <a href=\"https:\/\/appexchange.salesforce.com\/appxListingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<br> The GUMU&#x2122; Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for processing and execution of application programs at the click of a button.<br><br> For more information on our Salesforce products and services, contact us at <a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n\n\n\n<p><strong>Related Posts<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2020\/02\/10\/gumu-salesforce-tricks-tips-change-the-icon-image-next-to-a-erp-sf-linked-record\/\">Change the icon image next to a ERP-SF linked record<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2019\/08\/21\/details-about-gumu-external-uid-field\/\">Details about GUMU&#x2122; External UID field<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2017\/10\/06\/how-to-rename-the-field-label-in-salesforce-for-managed-package\/\">How to rename the Field label in Salesforce for managed package<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/12\/29\/using-roll-up-summary-field-formula\/\">Using Roll-Up Summary field formula<\/a><\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog signifies how a user can find the API metadata for a particular report. Before going through this blog make sure you have a keen understanding of reports, workbench and can understand sample apex code. User will generally use this method to find the API name for the field attribute in &lt;analytics:reportChart>. Using the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2020\/06\/24\/salesforce-tips-discover-the-api-metadata-for-salesforce-reports\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[823,796,822,824,821,825,793,820,794,826,609],"class_list":["post-5602","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-analytic-report-chart","tag-dynamic-run-a-report","tag-fetch-report-metadata","tag-get-api-of-field-used-in-report","tag-get-report-api","tag-pass-filter-value-using-apex-class","tag-report","tag-report-api","tag-report-url","tag-run-report-through-apex-class","tag-salesforce-report"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/5602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=5602"}],"version-history":[{"count":2,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/5602\/revisions"}],"predecessor-version":[{"id":5632,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/5602\/revisions\/5632"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=5602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=5602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=5602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}