External Database Integration | No errors but cannot display data on browser preview

Hi all,

I just started learning about external database connections and managed to successfully connect to one of our company’s databases.

I have created a mobile app and imported my custom extension in Service studio. It all worked and can preview the data in there.

I have created a screen containing a list that should display the data from my external database, have no errors but on preview my screen is blank.

I am sure I might have skipped a step or maybe done something wrong … can you please help me out?

Do i have to maybe bootstrap the data and add a timer first? 

Many thanks,

Cristina


Hi Cristina,

You're saying you created a Mobile App. Do you have any data synchronisation in place, or are you using a Server Action to retrieve the data from the external database?

Hi Kilian,

and thank you for helping me out. 

I don't think i have any data synchronization in place, i suspect this is part of the problem

I imported the database though manage dependencies, but i did not bootstrap the data or create an action to properly retrieve the data. Once i was able to preview the data in Service Studio i thought maybe i don't need to. 

When i previously imported entities from excel files i noticed the system automatically created timers and server actions so i somehow assumed this is the case when linking to an external database. 

Should i create an action similar to the Excel data synchronization? would that be similar?

Solution

Hi Cristina,

When you import an Excel file, you're actually retrieving the data from the Excel file and store that in the database. For that, a Timer is created. However, when you connect to an external database through an Integration Studio Extension, the data is being retrieved directly from that external database, it is not imported into the "local" (OutSystems-managed) database (which is a good thing!).

Since Preview works as expected, I'm going to assume the connection itself works. You could try creating a small Web App (so not a Mobile App) for testing, just drag the Entity onto the canvas and Service Studio will automagically create a paginated Table Records that displays the data. If that works, you can safely assume everything's fine with the Entity.

How do you retrieve the data in the Mobile App? Via a Screen Aggregate ("Fetch Data from Database" in the Screen's contex menu)? Or via a Server Action?

Solution

Hi Kilian, 

thank you for that it actually makes a lot of sense. I will try it with an Web app and see what happens. 

I retrieved the data via screen agregate, Fetch data from the database (it might be the lazy way but at this point it's the only way i know how). 

I also get a timeout error pretty soon after i do my preview in browser. Would you reccomend storing the fields i need on a local database?

Hi Cristina,

Whether or not you want to sync data with the Local Storage depends heavily on what you want to do, so it's difficult giving a generic advice. Using server-side storage of course means the app has to be online, otherwise the server can't be connected. Also, in case of large data transfer, it may take a while before the user sees meaningful output. On the other hand, if you have a lot of data, storing it all locally might also not be a good idea.

Hi Kilian, 

and thank you for your help. I created a web app and loaded and previewd the data as expected. 

I encountered only one small issue, in order to preview my data in browser i had to limit the number of fields displayed. 

It's all working now, thank you

Cristina 


Hi Cristina,

Thanks for the feedback, and great to hear it works now. Happy coding :).