Get resource content dynamically

Get resource content dynamically

  

Hi all,


Is there a way to get a Resource content dynamically using the resource name from a Text variable?


Thank you in advance,

Renato Torres

Hi Renato,

I am unable to understand your requirement.

Can you please describe?


Regards

-SK-

Shashi kant Shukla wrote:

Hi Renato,

I am unable to understand your requirement.

Can you please describe?


Regards

-SK-

Hi Shashi.

Yes, I want to replace the assignment below with a Resource that I select dynamically.

Instead of using a static Resource I would like to do something like "GetResource(Name).Content", where Name is a Text variable with the "Dollaricon_png" value.



Thanks,

Renato

Hi,


what do you want actually?

is this an image?



J. wrote:

Hi,


what do you want actually?

is this an image?



I'm generating demonstration content for an application. 

One of the entities has an image / logo that is stored in the database.

I'm assigning random images from the resources using a switch / assigns and would like to replace that with something more dynamic like having the resource name in a variable and get the content directly.

Thanks.

Solution

Hi,


why not use database-images then?

besides that, you need to do soemthing with the binary-data... perhaps base64 in the image-url...

Solution

J. wrote:

Hi,


why not use database-images then?

besides that, you need to do soemthing with the binary-data... perhaps base64 in the image-url...

Your suggestion is to put the demo content images in the database and then fetch them randomly? I can add preload the database with images from the resources with a bootstrap action and then go directly to the DB.


I was after a simpler solution but that's an alternative.


Thank you again.



simpler solution is making them actual images and dumping on the screen and having if-widgets around them ;)


J. wrote:

simpler solution is making them actual images and dumping on the screen and having if-widgets around them ;)


As I'm building a module to populate an application with data with a combination of Excel information (where I have the resources names) and random/fake data, I really need to write the database and cannot handle it just at the UI level.  


I just stored the Resources in the DB and fetch them per name as needed and It's good enough for now.


If I still have time I will probably try a combination of "Deploy To Target Directory" option and the usage of the FileSystem extension.


Thank you again for your help and time.