36
Views
4
Comments
Solved
Parsing a list between screens

In screen A i have a table,where,using checkboxes I select a number of items(entire table rows) and I want just the selected rows to appear in a list in screen B,each selected row table from screen A in a separate list item in screen B.The problem is I cannot use list or record as input parameters.Any suggestion or solve to this problem?

Thx.

Solution

Hello Morar Marian Gabriel, 

Why not think about creating a flag boolean associated with the ID of the selected ones and save that info, for example: IsSelected :) So, every time you use the check and check it, it records true, and false if you uncheck. That on-screen A. Note: you already have a boolean associated with the checkbox, you can use it to filter the aggregate/query on screen B if you are saving it on the db. 

On-screen B, you just need to fetch the ones who have that flag, meaning, IsSelected equals true.

If you don't want to record and save/create this new attribute on the database, you can always do what it suggested here: 

Best regards, 

Ana

Solution

Hey Morar,

I have created a sample OML where I have stored the ID for the checked record.Lets take an example.


IsChecked        ID          Name 

false                   1             A

true                    2             B

false                   3             C

true                    4             D

true                    5             E


I have created a button where I am iterating the list and storing the ID in "store" variable and passing "store" to another screen (DemoScreen).

1st loop

store   =     ""  +  "#"+2+"#"         =     "#2#"

2nd loop

store   =     "#2#"   +  "#"+4+"#"         =    "#2##4#"  

3rd loop

store   =     "#2##4#"    +  "#"+5+"#"         =    "#2##4##5#"  



In DemoScreen I have used an aggregate where I have used the below filter to filter out selected records.

Index(Store,"#"+Employee.Id+"#")<>-1



I am attaching an OML. I hope this will help you!

Have a great day!

Thanks & Regards,

Sudip Pal


PasingVar.oml
Solution

I understood your question, what you can do is on screen A get the list of selected items and serialize it using jasonSerialize and on screen B create a input variable with text data type. Now from screen A send a serialized text string to screen B through input variable you created and on screen B deserialize it.

This way you will get the selected list in screen B.

But in this approach please dont serialize all the record data because there is limitation on length of url you pass as the serialized text will be passed as query parameter in url. What you can do is serialize only unique column such as ids only and on screen B after deserializing get the data from database using that Ids

Regards,

Pramod.

Solution

Hello Morar,

For passing data from one screen to another you can use JSON Serialize and Deserialize.

Please go through the documentations:-

https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/implementing_logic/logic_tools/json_serialize/

https://itnext.io/serializing-deserializing-json-in-the-outsystems-platform-ae08f2f6b5b4

https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/implementing_logic/logic_tools/json_deserialize/

I am sharing a sample OML with you please go through it.

Hope it helps you..!

Regards,

Pavan R

Serialize_DeSample.oml
Solution

Hello Morar Marian Gabriel, 

Why not think about creating a flag boolean associated with the ID of the selected ones and save that info, for example: IsSelected :) So, every time you use the check and check it, it records true, and false if you uncheck. That on-screen A. Note: you already have a boolean associated with the checkbox, you can use it to filter the aggregate/query on screen B if you are saving it on the db. 

On-screen B, you just need to fetch the ones who have that flag, meaning, IsSelected equals true.

If you don't want to record and save/create this new attribute on the database, you can always do what it suggested here: 

Best regards, 

Ana

Solution

Hey Morar,

I have created a sample OML where I have stored the ID for the checked record.Lets take an example.


IsChecked        ID          Name 

false                   1             A

true                    2             B

false                   3             C

true                    4             D

true                    5             E


I have created a button where I am iterating the list and storing the ID in "store" variable and passing "store" to another screen (DemoScreen).

1st loop

store   =     ""  +  "#"+2+"#"         =     "#2#"

2nd loop

store   =     "#2#"   +  "#"+4+"#"         =    "#2##4#"  

3rd loop

store   =     "#2##4#"    +  "#"+5+"#"         =    "#2##4##5#"  



In DemoScreen I have used an aggregate where I have used the below filter to filter out selected records.

Index(Store,"#"+Employee.Id+"#")<>-1



I am attaching an OML. I hope this will help you!

Have a great day!

Thanks & Regards,

Sudip Pal


PasingVar.oml
Solution

I understood your question, what you can do is on screen A get the list of selected items and serialize it using jasonSerialize and on screen B create a input variable with text data type. Now from screen A send a serialized text string to screen B through input variable you created and on screen B deserialize it.

This way you will get the selected list in screen B.

But in this approach please dont serialize all the record data because there is limitation on length of url you pass as the serialized text will be passed as query parameter in url. What you can do is serialize only unique column such as ids only and on screen B after deserializing get the data from database using that Ids

Regards,

Pramod.

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