# Pull first 8 characters

**URL:** <https://connective.celigo.com/t/pull-first-8-characters/999>\
**Category:** Integrator.io\
**Tags:** edi, handlebars\
**Created:** [December 2, 2024, 9:54pm UTC](https://connective.celigo.com/t/pull-first-8-characters/999 "2024-12-02T21:54:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackharris](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/jackharris/32/6618_2.png) [@jackharris](https://connective.celigo.com/u/jackharris)\
**Post date:** [December 2, 2024, 9:54pm UTC](https://connective.celigo.com/t/pull-first-8-characters/999/1 "2024-12-02T21:54:26Z")

</div>

I'm receiving 11 digits through EDI. I only need the first 8. When I try to use a handlebar, I get the following error.

 ![5301043caa20740200000001-70c6e564cad74825ab0054c4e65aebb0.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/7/743fccdcb21a01f8a4f509766310816c7d4f55b0.png)

This is what the data looks like

![5301043caa20740200000001-7a6ae8d05bf64c3db21211004f376999.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/7/7e05a2bc2d9d96f4d187e1845b3250f3e57470b6.png)

What am I missing here?

---

<div class="post-metadata">

**Author:** ![friendoftuesday](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@friendoftuesday](https://connective.celigo.com/u/friendoftuesday)\
**Post date:** [December 2, 2024, 10:09pm UTC](https://connective.celigo.com/t/pull-first-8-characters/999/2 "2024-12-02T22:09:33Z")

</div>

There probably is a more efficient way to coerce a number to a string, but I use the “join” helper to concatenate the field with an empty string:

`{{substring (join '' record.Lines.0.lot) 0 8}}`

---

<div class="post-metadata">

**Author:** ![jackharris](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/jackharris/32/6618_2.png) [@jackharris](https://connective.celigo.com/u/jackharris)\
**Post date:** [December 3, 2024, 2:00pm UTC](https://connective.celigo.com/t/pull-first-8-characters/999/3 "2024-12-03T14:00:42Z")

</div>

I emailed it to you as well as a test file. The Export that I'm troubleshooting this on is KLE - 943 and if it works there then I'll do it on KLE943 (sorry about the similar names 😅).

---

<div class="post-metadata">

**Author:** ![jackharris](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/jackharris/32/6618_2.png) [@jackharris](https://connective.celigo.com/u/jackharris)\
**Post date:** [December 3, 2024, 2:02pm UTC](https://connective.celigo.com/t/pull-first-8-characters/999/4 "2024-12-03T14:02:21Z")

</div>

Also, this is in the transformation of the export. If I can't figure it out with handlebars, then I'll just program the transformation, but that's a lot of work around that I'd prefer not to have to do to remove 3 characters.

---

<div class="post-metadata">

**Author:** ![jamesroth](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/jamesroth/32/4368_2.png) [@jamesroth](https://connective.celigo.com/u/jamesroth)\
**Post date:** [December 2, 2024, 11:02pm UTC](https://connective.celigo.com/t/pull-first-8-characters/999/5 "2024-12-02T23:02:22Z")

</div>

If the error persists, is it possible there is a Transformation step after the Export, before the import in your flow? I wonder if the value for "lot" is set to something other than String.

 ![5301043caa20740200000001-5e5c74dbcf0a402d90ffe14e015f7a91.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/d/d7a6fabf63a320146eaac74bc54f04a00de8993e.png)

 ![5301043caa20740200000001-c197e3c092e44865b626ef521768b044.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/e/e5b1408e65cec3df9eefa517739c28028f1399bd.png)

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [December 3, 2024, 5:45am UTC](https://connective.celigo.com/t/pull-first-8-characters/999/6 "2024-12-03T05:45:37Z")

</div>

@jackharris I'm not able to reproduce this and what you sent works fine for my test. If you could email me the flow zip, that would help see if there is a bug that needs to be reported.

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [December 4, 2024, 5:39pm UTC](https://connective.celigo.com/t/pull-first-8-characters/999/7 "2024-12-04T17:39:33Z")

</div>

@jackharris it looks like there are a couple of issues.

1. You have `{{substring record.Lines.0.lot 0 8}}`, but the `lot` field is `Lot` in the data. When I used `{{substring record.Lines.0.Lot 0 8}}` it worked in preview.
2. After having it work in AFE preview, it isn't actually working in the entire transform preview and this is due to a bug in what you're seeing in AFE editor on step 1. To fix this, just use `{{substring record.Lines.Lot 0 8}}`. It will now work for the entire transform preview, but not the AFE editor preview. We will get a bug logged for this.
