# Reference to Value

### Case 1: Destination wants to use specific field from a referenced content

Assume you have a source content type: `Excursion` that has a reference field to a `Destination` content type. See content model:

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-da92e97804947f440cf4f60a0ff7bc289b01b55f%2Frecipe-reference-to-value-01.png?alt=media)

This is how the source content of type `Excursion` looks like:

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-985be44dd8eb08a7d29e3269e73d8757827d9b91%2Frecipe-reference-to-value-02.png?alt=media)

This is the referenced `Destination` content, take a look to the `Name` field, that's the one we want to use in the target endpoint:

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-2d6c65985a81dcf7bb552a6caee56a07889b274a%2Frecipe-reference-to-value-03.png?alt=media)

In the target endpoint, we have a content type `Excursion` that has a field `Location` that is a text field. See content model:

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-96b221b6c6ec1fd203ab0e2c5e05bc392bfa7cae%2Frecipe-reference-to-value-04.png?alt=media)

The value of the `Location` field in the target endpoint will be the value of the `Name` field of the referenced `Destination` content.

#### Solution

ImpulseSync can solve this with 2 jobs and couple manipulators. We will use both the [store-field](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/store-field) and [get-set-field](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/get-set-field) manipulators.

**Step 1: Create a job to sync the referenced content: `Destination`**

* First we create the job to sync the referenced content: `Destination` from the source endpoint to the destination endpoint.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-e865dcb52f6be2f87c40e82d770aa242ee6c5066%2Frecipe-reference-to-value-05.png?alt=media)

* Next we set up the `store-field` manipulator.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-a1cdafe0f3d62b30be89239491cba8651097bf40%2Frecipe-reference-to-value-06.png?alt=media)

This manipulator is configured to store the value of the `Name` field of the referenced content: `Destination`. This variable can be referenced later by the `get-set-field` manipulator.

**Step 2: Create a job to sync the referencing (main) content: `Excursion`**

* First we create the job to sync the referencing (main) content: `Excursion` from the source endpoint to the target endpoint.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-a5c446c2c087e30517516064d16616480dac891f%2Frecipe-reference-to-value-07.png?alt=media)

* Next we set up the `get-set-field` manipulator.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-6025f2dec1126dd700d1cb5f72fd3fcb69dd8cb6%2Frecipe-reference-to-value-08.png?alt=media)

This manipulator is configured to get the value of the `Name` field of the referenced content: `Destination` and set it to the `Location` field of the referencing (main) content: `Excursion`.

**Step 3: Run the jobs**

Now we can run the jobs and see the results.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-0042ab11c1f20fe833dabb6990fc60ac628f7fd9%2Frecipe-reference-to-value-09.png?alt=media)
