How can i add static documents do my module, and then either provide them to the end-users via a link or do something with them if a button (for instance) is clicked.


Seems like a simple thing but i really can't find an answer to this.

At the bottom of the data tab there's a resources folder, upload your documents there. 

To provide them to the user, create a screen action that ends in a download widget and use "resources.[filename].content" as the File Content.

Zachary wrote:

At the bottom of the data tab there's a resources folder, upload your documents there. 

To provide them to the user, create a screen action that ends in a download widget and use "resources.[filename].content" as the File Content.


More info here: https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Use_Resources

Solution

Hi Carlos,

How static are they? Depending on the answer, there's a couple of ways to do it:

 - Sort of static, say you'll change them once every six months or so: create a couple of Entities to model those files and a backoffice to maintain it, and then just offer and fetch the documents in the frontend when you need them;

 - Very static, you won't be changing them in the foreseeable future: add them to the Resources folder in the Data tab of your Module:

You can then reference them and download their binary content.

Solution

Afonso Carvalho wrote:

Hi Carlos,

How static are they? Depending on the answer, there's a couple of ways to do it:

 - Sort of static, say you'll change them once every six months or so: create a couple of Entities to model those files and a backoffice to maintain it, and then just offer and fetch the documents in the frontend when you need them;

 - Very static, you won't be changing them in the foreseeable future: add them to the Resources folder in the Data tab of your Module:

You can then reference them and download their binary content.

Ok, what if i want to grab the file and process the content?

When i try to assign a resource to a variable the enviroment reads it as a binary (makes sense) but i know the content is a string. So how can i read the resource as a string.


Hi,

It's important set the property Deploy Action, like follow:

Carlos Belo wrote:

Afonso Carvalho wrote:

Hi Carlos,

How static are they? Depending on the answer, there's a couple of ways to do it:

 - Sort of static, say you'll change them once every six months or so: create a couple of Entities to model those files and a backoffice to maintain it, and then just offer and fetch the documents in the frontend when you need them;

 - Very static, you won't be changing them in the foreseeable future: add them to the Resources folder in the Data tab of your Module:

You can then reference them and download their binary content.

Ok, what if i want to grab the file and process the content?

When i try to assign a resource to a variable the enviroment reads it as a binary (makes sense) but i know the content is a string. So how can i read the resource as a string.



Ok i've found out that i can add a dependicy to convert from binary to text.
Not the way i was expecting but it works thanks everyone.

I assumed you'd just be offering the files for download! That way you could just send the binary data in a Download action. If you want to display/process their content then you will need to do those conversions.