Updating dashboard
Application Type
Traditional Web, Mobile, Reactive, Service
Service Studio Version
11.10.19 (Build 41209)

Hi all,

I am building a dashboard screen that needs to update regularly. My data is coming from an excel file that I have bootstrapped to my dashboard components (Line Charts, Area Charts etc). I am not sure how to update the widgets. Ideally, if there were any changes made to the excel file I would like this to be implemented on the widgets. Any help will be greatly appreciated 

Hi Tamim Ehsan,

Once you bootstrapped excel to outsystem entity, all data will be in entity. This data you can bind to widgets. If your excel file get update then you need to bootstrapped again. And please update more for your issue.

Please see link : https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Bootstrap_an_Entity_Using_an_Excel_File 


Hi @Pranav Shingane,

Thank you for your reply! Is there a way to have the data update on the widget as the excel file is updated? Would it make more sense to use a database instead of an excel file? The data in the excel file is constantly being updated therefore I would like to have a way to show this on the widget as well. 

Hello @Tamim Ehsan,

No, there is no any widget that perform the task for updating data to outsystem entity.  And yes, it will make sense to use outsystem database instead excel file. 


Hi Pranav,


If I do go down the database road, would I have to implement some sort of trigger to get the latest data from the database? 

Hi,

When the data from excel sheet updated and you bootstrap that in entity then when you fetch the screen that time just refresh the entity,

If you want to do it manually then there is no way.

Regards ,

Komal

Hi Komal,

Is there a way to refresh the entity inside the process? or is it done manually?

Yes you can do it inside automatic activity.

Hi Komal,

Is there any way of showing me how to do this? I have bootstrapped the excel file onto a widget but I am not sure how to update that widget as the excel file gets updated

Hi Tamim Ehsan,

The data is in entity ..right?? or in structure, I am not getting your sentence of  " bootstrapped the excel file onto a widget "


Hi @Komal Kumbhar,

Sorry for the confusion, I have put my data into outsystems like so:

I have right clicked and added my excel by going into the Data section and right-clicking on an entity that I have created and then selecting "Create Action to bootstrap data using excel"

 

This has successfully loaded the data from my excel file into OutSystems 

I have then used the bar chart widget and used the data I added as the source. If there is a change in the excel, is there a way to update the bar chart widget when the solution is live?


Hi,

Bar chart is in screen right and some one is open that screen to check the details right???

If its traditional app then fetch the entity of source into the preparation , so whenever you update the data with bootstrap it will reflect to the bar chart.

If it's reactive app then create OnInitialize action and on that action refresh the source entity of bar chart it will reflect the new details on the bar chart.

Regards,

Komal

Hi @Komal Kumbhar ,

I am using a reactive app but I am not sure how to create a OnIntitialize action. Is there any documentation on it that you might know of?

Thanks,

Tamim

Hi Tamim,

Go to your dashboard screen and select OnInitialize Event like below screen shot,

 In that action refresh your source entity of bar chart like below screen shot,

It will update your data when ever you add new data to it,


Hope this helps,

Regards,

Komal,


Hi Komal,

I'm not sure I understand the point of this.  Is the aggregate not run anyway when first entering the screen (at least, when defined as 'at start', which is the default) ?  

This will just run it twice, right ?

Dorine

Hi @Tamim Ehsan ,


Just create one simple server action which will have same logic to :

1. Load the new data in database entity (Dashboard tables entity).

2. Update existing data in database entity.

3. Delete old data which is not available in excel sheet but available in data table (Only if required).


Call this above server action from Dashboard screen preparation. It will load the updated data on screen each time your screen refreshes.


Thanks,

Kaustubh

Hi @Kaustubh Joshi ,

I am not sure how to load new data in the server action. Do I just put the Aggregate activity inside of it like below?

Hi Tamim,

You are confusing a lot of concepts, and I think you would benefit from first understanding some basics of Outsystems.  Best way is following guided paths "becoming a reactive web developer" or "becoming a traditional web developer".  In your case reactive, i guess.  So at least try to get real understanding of what aggregates are, what is actually happening when you are bootstrapping data from an excel, and what the basic working parts are of a reactive application.

So, now, on to your question : can I summarize as follows?  : there is some data that is currently maintained in an excel, so the excel is your golden source.  In the future, you will keep it as such, anybody wanting to change the data, will do that by updating the excel source.  You are making a reactive app, and in that app, you want to display on one of the screens a bar chart based on the data in that excel.

You have chosen to bootstrap the excel file into entities.  What you have to understand is that you have done nothing more than use the excel columns as a guide of your entity definition, and the first time publishing after the bootstrap, you have used the data that were available in the excel at that time, to get an initial set of rows in your table.  Nothing more.  You can now of course make a bar chart based on the data in the entity, but that is forever the data that were there at the moment of bootstrapping.

So you will need to do a lot more, if you want your data in your entity to keep reflecting the data that are really in the excel file.  

  • You will need to build logic to pick up the latest version of the excel and update your entity to reflect the data.  You can look at the server action that was used for bootstrapping as an inspiration for your logic.  
  • You will need a way for your code to go pick up the latest version of the excel.  When bootstrapping it just added the file as it was at that time as a resource to the module, that's not going to work, so you'll need to go get the current excel (maybe ftp, maybe something else, depends on where it is maintained).  
  • Finally, you'll need to think about how you are going to trigger an update from the excel into your database.  Run a timer?  Everytime the entity is read ? Somehow find a way to trigger it based on a change in the excel???

Alternatively, if the only purpose of the entity is to allow you to make the chart, you might skip it alltogether and just go get the excel, turn it into a recordslist, and use that recordlist as the source for your chart.  So no need for an entity, no need for bootstrapping, no need for timers updating entity data...

I would go for alternative, unless you have a compelling reason to also keep the records in an entity.  Some reasons might be 

  • performance : if there are too much rows in the excel, fetching and converting the excel might take too long
  • transformation : if you want to make use of  aggregate/sql functionality to mould your data into something worth displaying in a chart
  • extra functionality : if there is much more you want to do in your app besides showing a chart, it might be worth it

Hope this helps to clarify and not confuse further,

Dorine

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.