246
Views
10
Comments
Passing a list as input from a screen to a block

When i pass a list from a screen to a block and then add items to the list from the block it should change the list also for the screen because its a refrence ? 

2025-04-15 04-00-33
Prakhar Sharma

Can you explain it with more details? 

What exactly are you expecting?

Regards,

Prakhar Sharma

UserImage.jpg
Yuval

i got an empty list in my screen , i pass the list as an input to a block , inside the block i append the list with a new item , inside the block the list did appended but somehow it didnt change the original list from the screen. so i want to know how can i pass a list and make changes from the block to the original list

2025-04-15 04-00-33
Prakhar Sharma

It will not automatically change on the screen. 

Once you update the list in the block, you will need to send back the list from the block to the screen using an Event and then in the handler of the event, you will need to assign the event list with the local list on the screen.

Kind of back and forth.

2024-05-08 06-29-37
Prince Aadil Khan Panwar

Hi @yuval twina 

take help from the OML. i am attaching below.

sample - Sample

mark my reply as solution if you find it appropriate.

Thanks

Prince

ListinBlock.oml
2019-01-31 08-54-57
André Costa
Champion

Hey @yuval twina ,

When appending new records in a block to your list, that lives inside its parent, follow these steps:


  1. Create an event and send your new list as an input.
  2. In the parent block (screen), create a new action (Action A) to handle that event.
  3. In Action A, set the local list (in the screen list) as the input you are receiving.


Check oml

ListBlock.oml
2022-07-11 14-05-36
Jeroen Barnhoorn

No, if you change the list in the block, the list in the screen won't change. For this you will need to use an event. You can then pass the list from the block to the event, after which the event handler can use this to update the original list in the screen.

Edit: André Costa beat me to it, and with a more elaborate explanation as well.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

This is the official way of passing data between blocks.

https://success.outsystems.com/documentation/11/developing_an_application/design_ui/reuse_ui/pass_data_between_blocks/

Passing by reference, to my knowledge is not available client side, and is only is done in two occasions server side

  1. between actions, and only if those actions are in the same module
  2. passing to extensions.

Regards,

Daniel

2020-09-04 11-39-50
Rogier Olde Dubbelink

In order to verify passing parameters by reference I tested this in O11 Reactive:

  1. between actions, and only if those actions are in the same module

But also in this case the list is passed by value.

Test scenario:

Server action 1

  1. Fetch a record list with an aggregate
  2. Pass the aggregate list to server action 2 (without mapping)

Server action 2 (in the same module):

  1. Add record to the list with ListInsert

After that, when returning to server action 1, the aggregate list hasn't changed.

I have never found a scenario in O11 Reactive where a list was passed by reference.
I would like to have that in order to split very long server actions, manipulating a record list, into smaller ones, passing the record list by reference, without having to copy the list and returning an updated version.


2025-02-10 17-24-13
Arun Rajput

Hi @yuval twina ,

My question is that when list is always empty then why are you passing it from parent screen to web block.

At the end you are appending values in list inside block then no need to use input parameter just convert it in local variable and as above suggested by other members use event handler to show this list on parent screen.

Best

Arun

2026-02-06 06-25-47
Mohan Sigamani

Hi @yuval twina 

I agree 

While interact(sharing values) from scree to the block, we will use input parameter.

 Likewise, from block to screen , we will use event to pass values. 

I believe , Your case is second one. You have to use event while appending values in the list and create a handler in the screen that will get your desired value and you need to store in another variable.

Hope it helps.

Regards,

Mohan

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