> 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/text-select-to-boolean.md).

# Text Select to Boolean

### Case

Assume the source content is an article with a select field of values.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-271f421cca1d8bee486608bc5cd92258ccb3abb5%2Fselect-bool-source-select-field.png?alt=media)

But it needs to sync to a destination field that is a boolean value.

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

Each source select value should either be true or false at the destination.

We need to be able to:

1. Change select to a boolean field
2. Change each select value to the appropriate boolean value

### Solution

ImpulseSync can do this with a job, content mapping, and the [regex manipulator](/impulse-user-manual/content-manipulators-motators/regex.md).

First create a job that will sync the article content to the destination.

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

The content mapping can be set to sync the field as boolean field.

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

This will change the select field to a boolean field when syncing the content.

Now we will use multiple regex manipulators to change select text values into boolean values.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-16d88c7daff80de088c4fb1e177f56c3a25b6bbc%2Fselect-bool-regex-manip1.png?alt=media)

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-818a2c7d353775f4d5edf0b981a852982cf2e97d%2Fselect-bool-regex-manip2.png?alt=media)

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-85f90d732e846f7fbe427fb7885b592849739cef%2Fselect-bool-regex-manip3.png?alt=media)

These three configs all take a different select text value and replace it with the appropriate boolean value.

```
Sponsored = true
Paid = true
Blank = false
```

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fgit-blob-5c6b6b37041a7a7d0a079277d2d5231cb6b564d7%2Fselect-bool-source-content.png?alt=media)

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