# Using 'append()' in Pipeline Block Editor does not work?

**URL:** <https://forum.inductiveautomation.com/t/using-append-in-pipeline-block-editor-does-not-work/84403>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 17, 2024, 5:45pm UTC](https://forum.inductiveautomation.com/t/using-append-in-pipeline-block-editor-does-not-work/84403 "2024-01-17T17:45:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [January 17, 2024, 5:45pm UTC](https://forum.inductiveautomation.com/t/using-append-in-pipeline-block-editor-does-not-work/84403/1 "2024-01-17T17:45:16Z")

</div>

this is a weird one. i copy/pasted some working code into the PBE (Pipeline Block Editor). it fails. here's the code:

```python
assetList = []
for item in py_userDataset:
  assetList.append(item['assetName'])
return assetList

```

this tanks out: `assetList` is empty. _whut?_ so on a wild guess, i tried this instead:

```python
assetList = ''
for item in py_userDataset:
  assetList = assetList + item['assetName'] + ','
return assetList

```

this actually returns a comma-delimited string of ALL the assets. BUT now a NEW problem presents itself: `split()` doesn't work:

```python
correctedList = assetList.split(',')

```

so why are these methods _ **not** _ working in the PBE? they work everywhere else!

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 17, 2024, 5:53pm UTC](https://forum.inductiveautomation.com/t/using-append-in-pipeline-block-editor-does-not-work/84403/2 "2024-01-17T17:53:50Z")

</div>

Out of curiosity, what happens if you try this instead?

```auto
return [item['assetName'] for item in py_userDataset]

```

What does the rest of the code look like? Did you change it between example 1 and example 2?

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [January 17, 2024, 6:46pm UTC](https://forum.inductiveautomation.com/t/using-append-in-pipeline-block-editor-does-not-work/84403/3 "2024-01-17T18:46:01Z")

</div>

the only thing that changes is what i've shown. everything works up to the point of using either the `append()` or the `split()`. so the `py_userDataset` is correctly generated; it populates the string concatenation just fine (all 200 items).

ultimately, what i need, given that i'm building a custom roster, is to wind up with a _list_ of a _dict_ of a _list_ (🙄) that looks like this:

```json
[{'email': ['blort@bink.ca', 'snort@donk.co.uk']}]

```

everything works until the `append()` or the `split()`. it's just ridiculous. for example:

```python
for item in py_userData:
  assetList = assetList + item['assetName'] + ',' #<-- builds fine
  otherAssetList.append(item['assetName']) #<-- does not compute

```

the output, from above, of `assetList` is a big string: `'blort@bink.ca,snort@donk.co.uk,(+198 more)'` which is what you expect. but there is NOTHING in `otherAssetList`. it just doesn't build. _and they are writing the same data!_🤯

and just to re-emphasize: this is ONLY in the PBE. it works JUST FINE everywhere else.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 17, 2024, 8:52pm UTC](https://forum.inductiveautomation.com/t/using-append-in-pipeline-block-editor-does-not-work/84403/4 "2024-01-17T20:52:06Z")

</div>

> [@ian.sebryk](#):
>
> ultimately, what i need, given that i'm building a custom roster, is to wind up with a _list_ of a _dict_ of a _list_ (🙄) that looks like this

So, JSON.

My thought is that even though you’re assuming the object you’re working with is just a standard python list, it can be and probably is something different depending on the context. However, it does have a string representation so the concatenation works.

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [January 17, 2024, 10:15pm UTC](https://forum.inductiveautomation.com/t/using-append-in-pipeline-block-editor-does-not-work/84403/5 "2024-01-17T22:15:28Z")

</div>

okay. i am so 😠 at this. i got on a call with Support. 2 hours. wasn't working. tech stymied. we started adding log statements to see why `append()` and `split()` weren't working. halfway through, having ONLY added log statements, script start working. no joke, no lie. tech was like: "huh, it's working now."

this isn't the first time this kind of thing has happened, either. tech is calling back in the morning to re-run through the project with me to find out what the hell happened. i'm absolutely banjaxxed. 🤯

i think our Ignition install is haunted... 👻 🎃 💀
