String SPLIT into Array function produces Appgyver Error

Good day,

I click on a list item and populate a string parameter when opening an edit page. The string parameter is verified working on the parameter page, and I’m trying to SPLIT that string into an array to show in a list – but I’m getting this error message.

CONTEXT: t2/page.Page6/id-1599521017391-67 | Log Entry, TIMESTAMP: 1599522452116, MESSAGE: k.toString is not a function TypeError: k.toString is not a function
at a.value (https://preview.appgyver.com/assets/bundle-1596112174271.js:126:354566)
at a.value (https://preview.appgyver.com/assets/bundle-1596112174271.js:58:53484)
at vo (https://preview.appgyver.com/assets/bundle-1596112174271.js:134:65663)
at mo (https://preview.appgyver.com/assets/bundle-1596112174271.js:134:65458)
at Xs (https://preview.appgyver.com/assets/bundle-1596112174271.js:134:99793)
at Fs (https://preview.appgyver.com/

This also occurs when I use the SPLIT function in a javascript box.

It looks like an Appgyver bug as “toString” is not an recognized JS function.
Any ideas on how to fix it? Thanks!

Hi there!

Not being able to replicate this error, so can you tell me a bit more about the setup and/or data item type?
Also what do you mean by using SPLIT in a JavaScript box?

Thanks for taking a look at this.

On the EDIT item page, the string page parameter comes from previous page list item when it is clicked.

The Page List Item STRING is then assigned to a LIST variable.

I do this by using a Function of SPLIT. This should split the string at each “;” into an array of texts, assign it to the LIST page variable, and populate the LIST on the edit page. I also tried doing this using Logic > Advanced > Javascript to no avail.

Here is the Edit Page List Item Page Variable that I’m assigning it to:

When I Click on the List item on the first page, I get this error:

Any Ideas?

With the added details I built what I think should be a repro, but can’t seem to generate the same error.
If you want to PM me your app id (this number -> https://platform.appgyver.com/builder/applications/12345) I can take a further look :slight_smile:

Okay, I managed to figure this one out :slight_smile:

The problem was in a repeat on the details page.
In the repeat binding you had “pageVars.APPRCH_List” which is a list of texts type.
However “repeat with” can only be used with list of objects type.

Changing the binding formula to:
MAP(pageVars.APPRCH_List, {name: item})
and then using current.name as the label, fixes the error.

However this should not cause a runtime error, so I’ll make a bug report on it!

Terrific - great job hunting that one down!

For the documentation, it said you could use a list, or a formula resolving to a list of objects. Maybe it needs to be updated to clearly specify this case.

https://docs.appgyver.com/app-logic/binding-data#repeated-components

Thank you so much!

Just wanted to clarify one point: yes repeats work with a list of objects, but SPLIT creates a list of texts. However I agree the UI could give better feedback on this!