Hi Team,
I have a structure list where I need to display Attachments
In DB I am not saving file size, I am getting that in data action by using binary data size action.
but in UI I need to display that -> file name, size, file added by
As I don't have file size in DB, I cannot add that in a table and add pagination and sorting as usually.
How to bind data and add sorting and pagination in the UI using str list
any reference or oml would be useful,
Thanks
Hi @Shain Lobo
Please refer to the below links regarding the pagination in the structure list:
https://www.outsystems.com/forums/discussion/75149/pagination-in-structure-list/
Thanks,
Supriya
I think that you should store file size in DB also. It could be a good solution for your problem.
If you cannot do this, you have to implement your own pagination.
Can you share your oml file?
I don't have access to create extra attr to store the file size
Hi @Shain Lobo ,
As a best practice and if you only pretend to list "file name, size, file added by" (as columns), you shouldn't request the file data in the data action (or are you going use that data?). Can you create a new db entity with all columns that you need (1 to 1 relationship to the current file entity)? If you can, you could update this new entity in background (e.g. timer), in that way you would also solve the pagination/sorting problem, you get information already processed and you could also request file data only on demand.
@Shain Lobo : I assume your entity as FileInfo ( Id , Name (Text), Content). Now you want to show the Name and Size in UI. You can use an advanced query to get the size as below
SELECT {FileInfo}.[Name], DATALENGTH({FileInfo}.[Content]) AS Size FROM {FileInfo}