Creating a dynamic list from a Web Service

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

Creating a dynamic list from a Web Service

#1

Postby alexmcclune » Fri Apr 21, 2017 9:01 am

Hi,

I am hoping someone can advise.

I would like to build a dynamic list from values retrieved from a Rest Web Service. I am able to retrieve the values and theoretically insert them into a table but I am unable to use these tables for a dynamic list as the table isn't "backed" by a resource.

The only solution I have, and it is undesireable, is to actually retrieve the data from the web server and then save it to a resource backed database table and then display the list. This will involve wiping the table every timer and re-populating during each form session. I was hoping I could do it "on the fly" from the Web Service.

Thanks,
Alex
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Apr 21, 2017 12:46 pm

You can do this on the fly, you don't need a database, you can use a "custom list" instead e.g.

Code: Select all

var list = fields.myfield.createCustomList();
for each (value in someloop)
{
  list.add(value );
}
Set the field type to dropdown and you will see the list.
0 x

alexmcclune
Ebase User
Posts: 95
Joined: Wed Feb 27, 2013 5:16 pm

#3

Postby alexmcclune » Mon Apr 24, 2017 2:36 pm

Thanks Jon, I actually found it very shortly after but only got it working today. I can see it being really useful as it allows me to pull a lot from an API and always have the right data in the ebase form...

Now to figure out the json parsing...that's causing me a headache now.
0 x


Who is online

Users browsing this forum: No registered users and 146 guests