Can you add images into a static entity?

Solution

Hi Curtis,

Yes that is possible.

Actually lot of the static entities in OutSystemsUI for Web and Mobile do have that.


On the record properties of a record in your static entity just change the icon property to the image of your choice,


Regards,

Daniel

Solution

In addition to my previous answer... Service Studio allows you to create a Static Entity with binary data as its type, but not to set the value. This a bug that has been reported years ago, but still not fixed.

Hi! 

I was considering that for the first time. Yes we can assign a picture to each record but it can only be used in the Service Studio!

To populate a binary data in a static entity I see only a way: 

Define the entity as a normal one ;

Fill the records with the images ;

Convert the entity to Static Entity

Graça

yes

Hi Maria,

I forgot about that option.

That is indeed the only way to get images as aditional attribute on a static entity.

It is not the fastest way to achive it but I have done it before and know it works.

Regards,

Daniel

If your use case is use image with Image widget, you can 

- Import Image(s) to Service Studio

   You can got the url of the image in Runtime Path property.

-  Add URL attribute to static entity and set the value with Runtime Path above.

- Use Image widget with External URL


Regards

Wei

Wei Zhu wrote:

If your use case is use image with Image widget, you can 

- Import Image(s) to Service Studio

   You can got the url of the image in Runtime Path property.

-  Add URL attribute to static entity and set the value with Runtime Path above.

- Use Image widget with External URL


Regards

Wei


I do not see the data type of URL in the drop-down?

Curtis ! 

The URL field are type "text" 


url is not a datatype, you must use text.

Stefano Valente wrote:

url is not a datatype, you must use text.


Then the Binary Data is not actual in the Entity, just a reference to the image.  I was looking to have the binary data in the entity.

that's correct. To do that, you can try Maria's solution:

"Hi! 

I was considering that for the first time. Yes we can assign a picture to each record but it can only be used in the Service Studio!

To populate a binary data in a static entity I see only a way: 

Define the entity as a normal one ;

Fill the records with the images ;

Convert the entity to Static Entity

Graça"

But since static entities are static, the url option might be better, with performance in mind:

The images can be stored as resource. The url point to the resource. This way you wont need binaries in your entity.