> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/devops/organizations/individual-organizations/retrieving-organization-metadata.md).

# Retrieving Organization Metadata

## ![](https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FG5ZbxX918xOHwbAwAJ4n%2FSummary2-Small-Icon.svg?alt=media\&token=da26a67f-ff7f-47b3-8669-06be960dc2d7) Overview

In Flosum Cloud DevOps, a **Retrieve** job fetches the most recent version of your organization’s metadata: the components that make up a branch. Each Retrieve job fetches only the components that have changed since the last retrieval.

This metadata is retrieved automatically every hour to keep you up to date on changes. Even so, it’s recommended to manually retrieve metadata before committing or deploying a branch that uses this organization, so you’re working with the latest data.

With a manual retrieve, you can configure a declarative filter to retrieve only the components that match the filter. This reduces the time a Retrieve job takes when many unnecessary components have changed in the organization.

This guide explains how to manually retrieve metadata for an organization.

{% hint style="info" %}

#### Retrieve Settings’ Excluded Components

If you have configured this organization’s **Retrieve Settings** to exclude any components from Retrieve jobs, excluded components are also left out of a manual retrieve, even when a **Declarative Filter** would normally include them. See the following article for more details about Retrieve Settings.

* [Changing Organization Settings - Retrieve Settings](/devops/organizations/individual-organizations/changing-organization-settings-retrieve-settings.md)
  {% endhint %}

{% hint style="info" %}

#### What is Metadata?

Read the following Salesforce article to learn more about what Salesforce metadata is and how it is used.

* <https://www.salesforce.com/data/what-is-metadata/>
  {% endhint %}

## Retrieve Metadata

{% stepper %}
{% step %}

### Start Retrieve

1. Click **Organizations** from the left sidebar menu.
2. Click the organization to retrieve metadata from.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2Fvvsg1J1yF1YK5wRyj26o%2FRetrievingOrganizationMetadata-S01-01.png?alt=media&amp;token=334f8535-5390-4981-b50c-d1bc2685e144" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click **Retrieve**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F1RwllXGcRkgC7HyTOJTT%2FRetrievingOrganizationMetadata-S01-02.png?alt=media&amp;token=4807ba53-5535-4765-9015-ecadb3667c74" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### (Optional) Add Declarative Filter

1. Click the **Declarative filter** toggle.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FcyA7TaYlIjQLgKeARDpK%2FRetrievingOrganizationMetadata-S02-01.png?alt=media&amp;token=43acd0ae-a5b9-48e7-9b57-81fae9fe592b" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click the **Select field** dropdown menu.
3. Select the field to use for the filter condition.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FivQ2Pi2Wkmnlthls4NJN%2FRetrievingOrganizationMetadata-S02-02.png?alt=media&amp;token=605f8d1b-8bea-4eb7-b4a4-a9968c4d1fdb" alt="" width="563"><figcaption></figcaption></figure></div>
4. Click the **Select option** dropdown menu.
5. Select the logic operation to use for the filter condition.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2Frj9WbYVOZ99p9En9edRr%2FRetrievingOrganizationMetadata-S02-03.png?alt=media&amp;token=8f92958c-5de4-4afa-9e6f-42b4a92780c5" alt="" width="563"><figcaption></figcaption></figure></div>
6. Enter a filter **Value** in the last filter box of the filter condition.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F014FiJ5JwLnoXln2NaRS%2FRetrievingOrganizationMetadata-S02-04.png?alt=media&amp;token=b9adaf3c-40f5-4f66-b807-9da19b5dacdc" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
The last filter box of the filter condition adapts to the type of **Field** selected in the first filter box. For example, in the screenshot above, **lastModifiedDate** is selected, so clicking the last filter box opens a date picker where you can select a valid date.
{% endhint %}
{% endstep %}

{% step %}

### (Optional) Add Multiple Declarative Filters

You can add multiple declarative filter conditions and combine them in two ways:

<table><thead><tr><th width="140.333251953125"></th><th></th></tr></thead><tbody><tr><td><strong>Basic Logic</strong></td><td>All filter conditions are combined with an <strong>AND</strong> operation, meaning all filter conditions must be met.</td></tr><tr><td><strong>Custom Logic</strong></td><td>You can combine filter conditions by defining your own logic using <strong>AND</strong>, <strong>OR</strong>, and <strong>()</strong> operations. Filter conditions are referenced by their row number. For example, <code>2 AND (1 OR 3)</code> means that the filter is true if condition 2 is met and either condition 1 or condition 3 is met.</td></tr></tbody></table>

1. Click **Add Filter** to add another filter condition.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FOFmnaMR1ayHks2zpXxZS%2FRetrievingOrganizationMetadata-S03-01.png?alt=media&amp;token=890852e6-2b11-41e5-b1e8-9fa043d0bec6" alt="" width="563"><figcaption></figcaption></figure></div>
2. Complete the filter by following the instructions in the section above.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FIjUYt5qbA0QspZJTYUuh%2FRetrievingOrganizationMetadata-S03-02.png?alt=media&amp;token=303e864e-f6d1-4e29-9d93-216dc61362e0" alt="" width="563"><figcaption></figcaption></figure></div>
3. Repeat this process to add as many filter conditions as needed.
4. Determine how you want the filter conditions combined. See the table above for an explanation of the options. If **Basic Logic** is used, no other action is necessary.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F09XgRsV4ECDHEIPqLeJD%2FRetrievingOrganizationMetadata-S03-03.png?alt=media&amp;token=0fd0557d-5d26-4521-9e4b-147f303eb061" alt="" width="563"><figcaption></figcaption></figure></div>

**Use Custom Logic**

1. Select the **Custom** option to enable custom logic.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FoAqUvhsWv1Eks9shWLni%2FRetrievingOrganizationMetadata-S03-04.png?alt=media&amp;token=4a478b2f-3f0b-456c-a2a0-4d0b22c612a3" alt="" width="563"><figcaption></figcaption></figure></div>
2. Enter your custom logic in the text box to the right of the dropdown menu.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F7s4lydjuyU1EGDSKi88t%2FRetrievingOrganizationMetadata-S03-05.png?alt=media&amp;token=e8b7a240-3dd2-448c-9ef2-dfa453ddf545" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Custom logic can use **AND**, **OR**, and **()** operations to combine filter conditions by their row number.
{% endhint %}
{% endstep %}

{% step %}

### Run Retrieve

1. Click **Run** once you have finished configuring the Retrieve job.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FWY6gOZni79WAzhOcD4Cz%2FRetrievingOrganizationMetadata-S04-01.png?alt=media&amp;token=36f6936e-f9d1-4322-bcdb-76962db647e4" alt="" width="563"><figcaption></figcaption></figure></div>
2. After starting the Retrieve job, you will be taken to the **Activities** tab, where you can view its status.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F4s8GbI2yezeQLT0RgEN6%2FRetrievingOrganizationMetadata-S04-02.png?alt=media&amp;token=3152369c-c5cc-4c54-ae68-728fe3ae866f" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Retrieve Status

The Retrieve job can take several minutes to complete, depending on how many components it is retrieving. The job starts as **Queued**, then changes to **In Progress** once it begins working. Click the refresh button to update the job status.

For large Retrieve jobs, the status may show **Partially Completed**. This means some components have already been retrieved and are available to use while the job continues retrieving the rest in the background.
{% endhint %}

3. Wait for the job status to show **Completed**.
   {% endstep %}

{% step %}

### View Log

{% hint style="info" %}
In the Retrieve job log, you can track the actions taken, including components added or deleted since the last retrieval. It also highlights errors, which is crucial for troubleshooting. For more details about the Retrieve job’s results and logs, see the following article.

* [Viewing an Organization's Activity](/devops/organizations/individual-organizations/viewing-an-organizations-activity.md)
  {% endhint %}

1. Click the job’s **Retrieve** link to view the log.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F5KoPlubKa595E854C0aC%2FRetrievingOrganizationMetadata-S05-01.png?alt=media&amp;token=d0ccda9c-d38a-4c9a-a477-12f690966592" alt="" width="563"><figcaption></figcaption></figure></div>
2. The following screenshot shows an example of a Partially Completed job that has not yet detected any changed components.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F3bEjXfw47UB171PksCPz%2FRetrievingOrganizationMetadata-S05-02.png?alt=media&amp;token=4287d4d7-0752-473c-a8f1-c80c32391bcc" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/devops/organizations/individual-organizations/retrieving-organization-metadata.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
