How to display the count of images that are not assigned in table record

Hi,

I am using two tables, image table which has all images  and  table1 with data. I want to know how many images are assigned  And not assigned in table1.


Any ideas?


Thanks,

Anusha

Hi Anusha,


If its only the number of assigned and unassigned and if the structure  of the table1 you can:

1. remove duplicate image identifier in table1 (you can use DistinctRecordList from SortRecordListExtension)

2. now, the length of the new table1 list is the number of assigned images

3. image table - new table1  list is the number of unassigned list

Please see attached oml

Hope this helps.

Hi,

The number of images assigned corresponds to the number of images you have. A word of advice, since the image information table is the same size as the binary table, the binary table ID may be the same as the image information table ID.

What I'd like to add, is that in case you want to store them in the database, it is good practice to have a seperate Entity that contains just an Id and the Binary data (and optionally the file name or the like). The reason for this is that databases store binary content in a specific way, which may interfere (as in "slow down") with normal database stuff like searching and indexing.

So say you want to store the image of a person, and you already have a Person Entity, create a seperate PersonImage entity that stores the image, and uses a "Person Id" as its identifier (so you have a 1:1 relationship).


Example:

Resultado de imagem para outsystems data model image

Cheers,

Nuno Verdasca