> For the complete documentation index, see [llms.txt](https://motivlabs.gitbook.io/impulse-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://motivlabs.gitbook.io/impulse-user-manual/cookbook-recipes/asset-to-structured-content.md).

# File (.doc) to Structured Content

### Case

Assume a Word document (.docx) is stored as a media file in a source system. That document has all the details on how to populate a content type in the destination system.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-ba99a55fd977f2a5b026cf9ed6724ebab4f46542%2Fasset-CT-doc.png?alt=media)

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-5fffda8c42d4a6d2ede89a97dfb256e6b0019aa5%2Fasset-CT-media-asset.png?alt=media)

While this media asset exists at the source as a document file, the destination is actually a structured content type with fields that need to be populated based on values in the source document.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-cbd44e0c5dcfd554d06f84891598005166480c6a%2Fasset-CT-dest-ct.png?alt=media)

We need to be able to

1. Parse the binary document into separate fields
2. Map parsed fields into destination content type

### Solution

ImpulseSync can solve this with a single job and couple manipulators. We will use both the [file-to-text](/impulse-user-manual/content-manipulators-motators/file-to-text.md) and [liquid-field manipulators](/impulse-user-manual/content-manipulators-motators/liquid-field.md).

First we create a job to pick up the source media asset and sync it to the destination content type.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-5178a87c734e345dddc77b04914baae32d405524%2Fasset-CT-job.png?alt=media)

Next we set up the file-to-text manipulator.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-37432a54bb0335e3c75a96636dae754eca7a4e8b%2Fasset-CT-file-text-manip.png?alt=media)

This manipulator is configured to take the binary of the asset and convert it into text. That text will be stored in a new field called `binaryAsText` field. This new `binaryAsText` field can be referenced later by other manipulators or the content mapper.

The next manipulator to configure is the liquid-field manipulator

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-eb3a88c7ac2a2188e1559b7b0ea4b0e640c5fbc3%2Fasset-CT-liquid-manip1.png?alt=media)

This manipulator is configured to create a new field called `field1` using a liquid template as the value.

liquid field value 1:

```
{{ content.en.fields.binaryAsText.value[1] | section: 'Booking code: ', 'Voyage name:  DO NOT CHANGE' }}
```

The liquid template uses the previously created `binaryAsText` field's value and the [section filter](/impulse-user-manual/content-manipulators-motators/liquid-field/filters/section.md) to get a specific section of the document. In this case the section between `Booking code:` and `Voyage name: DO NOT CHANGE` will be set as the value for the new field `field1`

Similarly, 2 more fields are created using the liquid-field manipulator.

liquid field value 2:

```
{{ content.en.fields.binaryAsText.value[1] | section: 'Voyage name:  DO NOT CHANGE', 'Link to images for approval: ' }}
```

liquid field value 3:

```
{{ content.en.fields.binaryAsText.value[1] | section: 'VOYAGE DETAILS:', 'Short description: ' }}
```

In total, the job now has 4 manipulators. 1 file-to-text and 3 liquid-field manipulators

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-d64893661fb68838952de73d85994a3235d2b0e6%2Fasset-CT-total-manips.png?alt=media)

Finally, we configure the content mapper to map our newly created fields into the correct fields for the destination content type.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-f9fae361047e1a310c96905f71a5742593cf1e43%2Fasset-CT-mapping.png?alt=media)

Mapping it as follows:

* field1 -> bookingCode
* field2 -> voyageName
* field3 -> voyageDetails

Now we can run this job and view the synced content.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-0bed662b81d631f72fd63a76e602c889fb3b457c%2Fasset-CT-list-content.png?alt=media)

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-c97e2883d6d3a6bdb69245ea8cabb58f0ec976a7%2Fasset-CT-view-content.png?alt=media)
