Select control array push


Ryan Sytsma

I have a series of HTTP controls that get json data from API and then the results are put into Select controls. The 1st Select control works fine but the 2nd one throws this error:

Line 386 is in this code block of app.js



Ryan Sytsma

Here is another example of code using a ArrayPush to a Select will fail.



DecSoft

Hello Ryan,

Maybe it's a typo? That is, maybe you are using an invalid identifier: "selectContract", maybe is "SelectContract", remember that Javascript is case sensitive. If I place in an app view a Select control like "Select1", there is no problem to push a new item into their Items property:

However, if by mistake a write "select1" instead, the below code produces exactly the same error that you get.



Ryan Sytsma
Hi David

I found the issue. Before I started my loop to get the array items to push into selectContract, I was calling:

To clear out any items. It should have been:



DecSoft

Hello Ryan,

Glad to know that you got it. Remember that you can use the "ArrayClear" action to clear an Array variable.



Ryan Sytsma
Thank you David

DecSoft

You're welcome! ;-)


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.