Need to reset data as it was from excel

I've imported data from some excel sheets, after that I had done modifications to the entity, using some server actions, I derived from those excel sheets, how can I revert back to the same data I had imported from the excel sheets?

Hi Sumit ,

If you want to revert the entire data , simply remove all data from the entity and reload the excel sheet.

Also if this is an ongoing thing , you can keep the copy of excel sheet in a parent entity and use the table primary key in the table where your are storing the data to know which data has been loaded from which excel and than whenever you want to revert the data , just delete it from the entity and reload the sheet that you saved in your parent entity.



Regards,

-PJ-

Pramod Jain wrote:

Hi Sumit ,

If you want to revert the entire data , simply remove all data from the entity and reload the excel sheet.

Also if this is an ongoing thing , you can keep the copy of excel sheet in a parent entity and use the table primary key in the table where your are storing the data to know which data has been loaded from which excel and than whenever you want to revert the data , just delete it from the entity and reload the sheet that you saved in your parent entity.



Regards,

-PJ-

Hey Pramod, 

I've added some Additional Entity Attributes apart from the ones imported from the excel, I just want to reach a state where, I've all the attributes as they are, just the data flushed. Thanks a lot in advance, and also for the reply. :)

Regards,

KJ. 


Solution

Hello Sumit,

You can use SQL widget in the Screen Actions, Preparation Actions or Server Actions ( temporarily ) if you have access to the Database to Delete or Truncate the data from your Entities, but it will not reset the Identifiers of that particular Entity to 0. Hence it will only flush the data completely from your Entity without affecting added custom attributes.

For more information you can see the post on this link for discussions on Resetting Entity Identifier to 0 : https://www.outsystems.com/forums/discussion/34015/how-to-set-again-to-0-id-integer-at-table/

I hope this helps.

Thanks and Regards,
Nikhil Purohit

Solution

Hi Sumit ,

If it just about flushing the data which you imported you can simply do it from db side if you have access to it or you can create a dummy page with an button action to delete the data from the desired entity.

Or else if you want to delete the additional attributes also which you added after data import than you need to remove them from entity manually and publish the espace.

Please let me know if the requirement is something else and need more clarity on it.


Regards,

-PJ-

Nikhil Purohit wrote:

Hello Sumit,

You can use SQL widget in the Screen Actions, Preparation Actions or Server Actions ( temporarily ) if you have access to the Database to Delete or Truncate the data from your Entities, but it will not reset the Identifiers of that particular Entity to 0. Hence it will only flush the data completely from your Entity without affecting added custom attributes.

For more information you can see the post on this link for discussions on Resetting Entity Identifier to 0 : https://www.outsystems.com/forums/discussion/34015/how-to-set-again-to-0-id-integer-at-table/

I hope this helps.

Thanks and Regards,
Nikhil Purohit

This worked like a charm, Thanks Nikhil. :)

Regards, 

KJ

Nikhil Purohit wrote:

Hello Sumit,

You can use SQL widget in the Screen Actions, Preparation Actions or Server Actions ( temporarily ) if you have access to the Database to Delete or Truncate the data from your Entities, but it will not reset the Identifiers of that particular Entity to 0. Hence it will only flush the data completely from your Entity without affecting added custom attributes.

For more information you can see the post on this link for discussions on Resetting Entity Identifier to 0 : https://www.outsystems.com/forums/discussion/34015/how-to-set-again-to-0-id-integer-at-table/

I hope this helps.

Thanks and Regards,
Nikhil Purohit


Great

Sumit Kumar wrote:

I've imported data from some excel sheets, after that I had done modifications to the entity, using some server actions, I derived from those excel sheets, how can I revert back to the same data I had imported from the excel sheets?

Hi,


You can change the struct of excel, then made the same way you import.


Cheers,

Thiago Mari