Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Select object returning undefined

Questions related to using nuBuilder Forte.
Locked
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Select object returning undefined

Unread post by tonyd »

I am at a loss as to how my Select Object dropdown list returns only a list of "undefined" selections. I used the SQL Builder
sqlbuilder.jpg
which gave me this SQL statement
sql.jpg
But then I get this
undefined.jpg
BTW, the form and table for this Select Object were created manually. Any ideas?
You do not have the required permissions to view the files attached to this post.
TonyD
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Select object returning undefined

Unread post by toms »

Quoting the wiki:
SQL or List
The resulting list for this Object can be created 1 of 2 ways.

SQL - A valid SQL query that returns 2 columns - If you want any help building SQL, the SQL Button will direct you to nuBuilder's SQL Builder.
List - A list delimited by a | eg. 0|No|1|Yes
In other words, you need to include practive_types_id in your query.
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Re: Select object returning undefined

Unread post by tonyd »

Of course, it sounds so logical when you say it. :D

After adding the id column I get the proper list in the dropdown, but it won't save or restore the value.

Edit: The value getting returned is "null".
TonyD
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Select object returning undefined

Unread post by admin »

TonyD,

Is your query something like this?

Code: Select all

SELECT
    practice_id,             ##-- hidden value that will be saved.
    practice_types_types     ##-- value that will be chosen by the user
FROM practice_types
ORDER BY practice_types_types
Steven
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Re: Select object returning undefined

Unread post by tonyd »

yes
TonyD
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Select object returning undefined

Unread post by admin »

TonyD,

OK, then I have no idea why it isn't working for you.

Have you tried copying an Object that works and seeing what the difference is?

That's what I would do.

Steven
tonyd
Posts: 68
Joined: Sun Mar 04, 2018 6:38 pm

Re: Select object returning undefined

Unread post by tonyd »

Unfortunately, the only other Select objects use a simple ordered list and not SQL. I manually created the table that the Select relies on, but that shouldn't matter.

I think I will try creating the table again using Fast Forms this time and see if that changes anything.

EDIT: After creating a new Select object by first creating a new table and form using FastForms, everything works just fine. I have no idea why it would not work for a manually created form/table, but, at this point, I have wasted enough time.
TonyD
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Select object returning undefined

Unread post by admin »

.
Locked