Add images to a database entity

Add images to a database entity

  

Hi,


I need to add multiple images to a database entity which i can later use to fetch the images.

This is my database diagram. For example, the entity CategoryPicture has been created by right clicking the entity Categories going into advanced and then selecting the option "Import picture for 'CategoryPicture' entity". This option allows me to add a single picture which goes on to become the DefaultCategoryPicture.

My question is how can i add more pictures which will be stored the in entiity "CategoryPicture".


Thanks and Regards,

MC 

Hi MC,

You need to change the data model a bit. Instead of having the CategoryPictureId on Categories you need to have a categorieId on CategoryPicture. Same for SubCategory.

Regards,

Marcelo

Hi MC,

You need to build a screen in which you can upload pictures. There's a video in the learning section where this functionality is explained.

Cheers,

Menno

Marcelo Ferreira wrote:

Hi MC,

You need to change the data model a bit. Instead of having the CategoryPictureId on Categories you need to have a categorieId on CategoryPicture. Same for SubCategory.

Regards,

Marcelo


Hi Marcelo,

I have made your recommended changes to the database model. Thank you very much for that.
The real issue at hand is that i am unable to add images to image database entity. What can you suggest for that?

My category image entity have the following attributes now:

CategoryImageId (autogenerated), CategoryId, BinaryContent

Hi MC,

Check this video https://www.youtube.com/watch?v=ffOkZtBnWmE to learn how to do it.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi MC,

Check this video https://www.youtube.com/watch?v=ffOkZtBnWmE to learn how to do it.

Regards,

Marcelo

Hi Marcelo,

Thanks again for the reply. I think i am not quite able to explain my problem. I do not want to provide the app user with a way to upload images but store images myself during development of the app, in a database which can be fetched later on, when the app is being used. My issue is with storing the images in a database entity. 

Thanks and Regards,

MC


Hi MC,

If you want to set up the images during development time shouldnt the categories be set up like this? Because to accomplish that is with static entity.

During development you can't insert images to dB. What you can have is a static entity with the path of the image that you included in the espace. And the link would be something like this :"/eSpaceName/targetDirectory/image.png"

Or you can bootstrap the pictures like is suggested in this post https://www.outsystems.com/forums/discussion/34463/bootstrap-images/

Regards,

Marcelo

Hi People,

This reply is for anyone who is looking for information from this post in the future. I did solve my problem with help of the above answers, and changing my database model a bit.

I am not marking any of the reply as a solution because it would misguide people with questions in the future. 

Thanks everyone for your valuable contribution. 

Hi Mujtaba,

You can explain you solution on a post and mark it as the solution for this case.

Regards,

Marcelo