How to Pass data from a web block to screen without any action to trigger so

How to Pass data from a web block to screen without any action to trigger so

  

Hi, 

Currently my web screen has 3 web blocks and each  has various fields in it which are pre-populated with API responses. Now a user may or may not change the values for the field but in the end when we submit a form with the submit button on the screen I should be able to pass on the data to another API Call. Earlier I had managed to do so so with the help of OnBlur action but now the fields may or may not be edited by the user. Any suggestion on how could I achieve this?

The less desired situation is through session variables. Concurrent pages sharing variables is a mess you don't want to have. I've done it in two distinct ways over the years:

OutSystems way: Notify action transmits the value.

HTML way: Javascript editing a hidden parent field.

As usual OutSystems is a "build to change" approach. If you need to change a field, you just change it and is done. The Javascript can get confusing with a lot of fields as it seems to be your scenario. If you are not a web developer used to JS, stick with Notify.


Hi,

What about save all the fields to the DB all linked to the same GUID and get the values from the db before calling the API? The performance will degrade with this option.

Regards,

Marcelo

I would go with the Javascript solution mentioned by Nuno.


In cases like this I like to have a fake button on my screen (that holds all the webblocks) and in Javascript process all inputs, create a JSON structure and set to an input (in the main screen) with display:none.
After processing all the data, clicks in a hidden buttons that is bind to an screen action, gets the JSON content and parse to an OutSystems structure.


Cheers

Does Ajax from front end work ? I mean Javascript Ajax , not the outsystems Ajax. Has Anyone tried to write Jquery calls ?

I guess Api call that are made directly from front end might not be logged.