# FAQ: How can I conditionally handle the presence of different substrings in import mapping?

**URL:** https://connective.celigo.com/t/faq-how-can-i-conditionally-handle-the-presence-of-different-substrings-in-import-mapping/1291
**Category:** Integrator.io
**Tags:** mapper, import, handlebars
**Created:** [December 8, 2020, 11:30pm UTC](https://connective.celigo.com/t/faq-how-can-i-conditionally-handle-the-presence-of-different-substrings-in-import-mapping/1291 "2020-12-08T23:30:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![stephenbrandt](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/stephenbrandt/32/6891_2.png) [@stephenbrandt](https://connective.celigo.com/u/stephenbrandt)
#### Post date: [December 8, 2020, 11:30pm UTC](https://connective.celigo.com/t/faq-how-can-i-conditionally-handle-the-presence-of-different-substrings-in-import-mapping/1291/1 "2020-12-08T23:30:48Z")

</div>

**Q.** The {{[#contains](https://docs.celigo.com/hc/en-us/articles/360039326071-Handlebars-helper-reference#contains)}} handlebars block helper evaluates to true if a string is found in a variable. It also allows an {{else}} condition to show a different value if the test fails.

But what I’m trying to accomplish is to test for _different_ strings, along the lines of if-else if or switch-case logic. For example, my API’s IDs have separate prefixes for order types: “SVC-” for services, “PRD-” for products, and so on. Is there a way in a handlebars statement to test for both strings?

**A.** As long as your substrings are certain to be unique, you can apply multiple {{#contains}} blocks. Only the expressions that succeed will be mapped.

In the example below, a source id field of “SVC-1” would cause the current destination field to be hard-coded to “Services.” The second condition would be ignored.

```
{{#contains id "SVC-"}}Services{{/contains}}{{#contains id "PRD-"}}Products{{/contains}}
```
