How to change text on page from the backend

How could I change text on a page from the backend? This is since I don’t want confidential information to be accessible from the frontend.
Thanks in advance!

Please add details and explain what exactly you’re trying to do.

In the page, you’d do

$w('#someId').text = 'some text';

How would I do that from the backend? Like modify text on a specific page.

Is it possible to do this?

Yes that is possible.

  1. Send data from backend to frontend (STRING/ARRAY/OBJECT) doesnt’t matter.
  2. Getting the sent data on frontend and putting it into the element you want.

Process:

  1. Starting a call (on frontend), to start an exported (returning)-function on backend.
  2. Sending data with the call to backend (not always neccassary or desired).
  3. Backend-functions starts and do some process.
  4. Backend-function sending generated/found-data back to frontend.
  5. You get the data on frontend.
  6. Now do what ever you want on frontend with your received data from backend.

The are sometimes questions about, how to recognize if it is a backend-code or frontend-code?

There are 2 indicators which will tell you, if you are on frontend or backend?

  1. The first one is not quite exact, but you will find “export function” on backend more often than on front-end.

  2. The second one will tell you exactly that you are surely on backend-code, when you recognize, that not even one → $w(‘#…’) <— existing in CODE.

So back to your comment:

In the page, you’d do:

$w('#someId').text = 'some text';

Yes correct!

And ONLY on the FRONTEND you do that!

On backend you can NOT use → $W !