How to update the data in preparation?
Application Type
Traditional Web

Good day, I am kinda new on Outsystems and developing a web app right now.  I have data that has been updated by using bootstrap to an excel file. I just want to know if there is a way wherein I can update the also the data inside the preparation of the web screen? 

mvp_badge
MVP
Solution

Hi Sean,

Technically you can, but why you think you need to do this in preparation? During preparation you normally retrieve the data you need to display on a screen. Do if you add logic there to update data this will happen any time the screen is displayed.

If you need to process data that you bootstrapped, I would advice to edit the bootstrap logic and do the  work there.

Regards,

Daniel

Thank you, Daniel, actually what I am looking for is that I have updated the entities by doing bootstrap but the data in the preparation is not retrieving the updates, are there any workarounds on that one? 

Champion

Hi Sean,

Could you share the oml file or screenshot for the bootstrap action?

Bootstrap mostly runs at publishing, and by default, it's creating new data to Entity, but not update existed data.

Kind regards,

Hi, Tom kindly refer to  the attached screenshot here for your reference:


I wanted to update the data also on the table of the screen and the source is the data that is being used in the bootstrap. Thank you Tom 

Champion

HI
The check below is what I mentioned before. If the entity already has records in it the action will end.
Bootstrap does not update the entity.


Sorry, I don't understand what you want to achieve? Bootstrap just for initial data, It's supposed to run on Publish, and just insert data one time. If your excel changed and want to import data again you can delete all data in the entity first.

Kind regard,

Champion

Hi Sean,

Besides the use case, The answer would be yes.

You can update the data in preparation.

Kind regards,


mvp_badge
MVP
Solution

Hi Sean,

Technically you can, but why you think you need to do this in preparation? During preparation you normally retrieve the data you need to display on a screen. Do if you add logic there to update data this will happen any time the screen is displayed.

If you need to process data that you bootstrapped, I would advice to edit the bootstrap logic and do the  work there.

Regards,

Daniel

Thank you, Daniel, actually what I am looking for is that I have updated the entities by doing bootstrap but the data in the preparation is not retrieving the updates, are there any workarounds on that one? 

Champion

Hi Sean,

Could you share the oml file or screenshot for the bootstrap action?

Bootstrap mostly runs at publishing, and by default, it's creating new data to Entity, but not update existed data.

Kind regards,

Hi, Tom kindly refer to  the attached screenshot here for your reference:


I wanted to update the data also on the table of the screen and the source is the data that is being used in the bootstrap. Thank you Tom 

Champion

HI
The check below is what I mentioned before. If the entity already has records in it the action will end.
Bootstrap does not update the entity.


Sorry, I don't understand what you want to achieve? Bootstrap just for initial data, It's supposed to run on Publish, and just insert data one time. If your excel changed and want to import data again you can delete all data in the entity first.

Kind regard,

mvp_badge
MVP

Hi Sean,


You can but you shouldn't. To add to Daniël's good advise, you shouldn't have data updates on Preparation for several reasons:


1. Bad for performance - the screen only renders after Preparation logic runs until the end which of course takes longer if besides fetching data you're also updating data in the database;

2. It's error prone - it's easy to find yourself creating data on Preparation and suddenly after users visit the page a few times, you find yourself having more records than you expected;

3. Bad for maintainability - when somebody is checking the code or looking for a bug where data is inserted, Preparation will likely be the last place they look for because it's not supposed to have data updates there.


Given that you have a bootstrap mechanism in place, you should indeed update your data there as Daniël suggested.


Kind Regards,

João

Hi João,

This is well noted and will practice this advice from your end.

Thank you!

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