Entity in JavaScript
Application Type
Traditional Web

Hello,

I want to use Entity data inside JavaScript of Traditional Web.

Something like:

function entityRead(Entity.Name){

alert(Entity.Name);

}


How I can do it without convert data into HTML tags?

mvp_badge
MVP
Solution

Yes, I can imagine that's a use case that needs JS. You could perhaps try the RunJavaScript Action from the HTTPRequestHandler Extension, and insert the rectangle data from the database into the JavaScript?

mvp_badge
MVP

Hi Kirill,

This is unfortunately not possible. In a Traditional Web App, all code runs server side, as is the database. JavaScript on the other hand runs client side, in your browser. There is absolutely no way that JavaScript can access the database directly.

That said, why would you want to access data from the database in JavaScript? OutSystems is a low-code tool, it seems you prefer high code?

Thanks for quick response.

I need generate rectangles based on Entity data.

I don't know how to do it without <canvas> and JS.


mvp_badge
MVP
Solution

Yes, I can imagine that's a use case that needs JS. You could perhaps try the RunJavaScript Action from the HTTPRequestHandler Extension, and insert the rectangle data from the database into the JavaScript?

It works with RunJavaScript Action , but not sure that it's best solution.

Thank you for help!

mvp_badge
MVP
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.