# Creating a job

### Job main details

<figure><img src="/files/lvgN6O8KKZJOM8rjZDQo" 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="/files/WuIZlq9DUU5dfBHJ77JC" 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="/files/yyCuQ3tTUYXrW9CXLBtc" 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="/files/dyRMrGPu0mYU7kpfQ2E8" 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="/files/SwPs0fKhgxrH5FV6XDCP" 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="/files/cGQ9Lm9cvOyMFuaZH1xo" 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="/files/ARed1slINqydFigxvdap" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bigstart.gitbook.io/copytag-tags-to-metafields-app/creating-a-job.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
