function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vladimir BessonovVladimir Bessonov 

how to assign metadata to packages and how to create Application, tabs and other metadata for CICD pipeline?

Hi. I am new to Salesforce dev. 
I am confused about how to work with metadata and what is it exactly. 

I set up a pipeline with sfdx-project-cicd from salesforce. 
After I create and pushed 1 package I need to start creating metadata. 
when I used scratch org I was just pulling it from sandbox that was a copy of my production env for example. I was receiving lots of data that I don't need at all. 

After I deployed my GitLabPackage to sandbox I went to this sandbox and created App, Tabs. 

How do I get those App and Tabs? If I use pull I will get all the metadate from scratch org, and I don't need it. After pull I tried to do push and then I got lots of issues. I could not deploy what I pulled to Sandbox anymore. Errors related to some other objects, permissions, etc. 

I cannot figure out how to retreive the data with sfdx force:source:retrieve. What flags to add to retrieve App and Tabs? 

Can some one guide me throgh? 
how to assign Metadata to packages and how to retrieve it? 

 
ShirishaShirisha (Salesforce Developers) 
Hi Vladimir,

Greetings!

You can achieve this by creating the package.xml in the manifest to retrieve the required metadata like Custom Applications and Tabs only and deploy using the same package.xml to avoid the errors related to the other metadata.
 
<types>
    <members>*</members>
    <name>CustomApplication</name>
</types>
<types>
<members>*</members>
<name>CustomTab</name>
</types>


Reference:https://trailhead.salesforce.com/en/content/learn/modules/package-xml/package-xml-manifest?trail_id=architect-solutions-with-the-right-api

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri