# Creating a job

### Job main details

<figure><img src="https://1587807114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qJcoAKAEiXFMBiVFTbY%2Fuploads%2FaH0HxQD9nJTMcR0WvCN1%2Fimage.png?alt=media&#x26;token=33ff7feb-cd6b-42dd-902b-1d0e7861f649" alt=""><figcaption></figcaption></figure>

The main details for the job are:

* Title - used in the jobs list
* Job type \*\* - manual or scheduled. Manual will require manual starting/running by pressing the `Activate` trigger. Scheduled will allow you to schedule the task to run automatically every day, week or month at a very specific given time:

  <figure><img src="https://1587807114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qJcoAKAEiXFMBiVFTbY%2Fuploads%2FLLtDyGYGrnCkuB1QrI3r%2Fimage.png?alt=media&#x26;token=5166d8dc-6707-47a7-a543-c444678e6aff" alt=""><figcaption></figcaption></figure>

*\*\* Job type might not be available for your app plan*

## Rules

This is where the magic happens. This is the place where you can choose which tags to which metafields to be copied. Let's break it down.

Every single rule defines a particular metafield which will be loaded with information from tags. Within one rule you can have 1 or multiple conditions for matching tags.

## Rules examples

### Single rule with single condition (1 tag to 1 metafield)

In this example all tags with prefix `category:` are copied to metafield with name & key `myfields.category:`

<figure><img src="https://1587807114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qJcoAKAEiXFMBiVFTbY%2Fuploads%2F9ELuj0Ja0ZAppVmQf0rK%2Fimage.png?alt=media&#x26;token=6b3718c2-b8ec-4fb3-a1a3-585f609a1b87" alt=""><figcaption></figcaption></figure>

### Single rule with multiple conditions (multiple tags to 1 metafield)

The above example can be extended by adding additional tags (conditions) converted to metafields. For example, if you have both prefixed tags like `category:` and `type:` you can combine them like that by just adding a second condition:

<figure><img src="https://1587807114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qJcoAKAEiXFMBiVFTbY%2Fuploads%2FLGNJIOuJkwIBb7MQI1lw%2Fimage.png?alt=media&#x26;token=8a9e820c-9588-4384-bdc3-d308bf10d96e" alt=""><figcaption></figcaption></figure>

### Multiple rules

1 job can operate over different rules too. For example, if you need the `category` and `type` from above to be set into separate metafields - then you need 2 rules with 1 condition per rule. Here is an example:

<figure><img src="https://1587807114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qJcoAKAEiXFMBiVFTbY%2Fuploads%2F5RKU3tGN84p09A3X9w9h%2Fimage.png?alt=media&#x26;token=04087bbf-aacd-46c1-8b6d-651c3468bc55" alt=""><figcaption></figcaption></figure>

## Conditions

Conditions are basically the tags you'll be copying to metafield. A `condition` is created, the tag must match the given conditions in order to be copied to the metafields.

### Type: Exact tag

With `Exact tag` you can access tags that perfectly match your search and you can even change their values when copied to metafield.

The below example is for all products that has the tag `Blouses` and when this is converted to a metafield it will be written as `Tops`.

<figure><img src="https://1587807114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qJcoAKAEiXFMBiVFTbY%2Fuploads%2Fkgu3KkBRJR06LGJzujQK%2Fimage.png?alt=media&#x26;token=f9c60969-b5f7-402a-a649-723a62a2cfd1" alt=""><figcaption></figcaption></figure>

### Type: Prefix

With the  `prefix` type you can catch all tags starting with specific string as it was widely used in Shopify during the time. The value migrated to the metafield will be the data after the given prefix.

For example if you have tag like `category: dresses`and you set a condition with prefix `category:` , the value migrated to the metafield will be `dresses`.

<figure><img src="https://1587807114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qJcoAKAEiXFMBiVFTbY%2Fuploads%2FcJYq4L0NCauP8bwD1bw3%2Fimage.png?alt=media&#x26;token=3602e641-154c-4669-8a69-3d15ba766297" alt=""><figcaption></figcaption></figure>
