how to insert List in a Table Record Cell in database
Question

Hi , 

Can anyone help me in inserting List in a Table Record Cell in database. In my use case User will select multiple softwares list, how can I insert all the selected values to selctedList column in database.


mvp_badge
MVP

Hi,


Use a loop and pass your list and every iteration call entity creates action to save values record by record.

Please design DB such a way so that you can save multiple selection user wise.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships#:~:text=Module%20Tree-,One%2Dto%2DMany%20Relationships,associated%20record%20in%20Entity%20A%20.


Thanks.

mvp_badge
MVP

JitendraYadav wrote:

Hi,


Use a loop and pass your list and every iteration call entity creates action to save values record by record.

Please design DB such a way so that you can save multiple selection user wise.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships#:~:text=Module%20Tree-,One%2Dto%2DMany%20Relationships,associated%20record%20in%20Entity%20A%20.


Thanks.


Hi,


Just update ur code and added logic to save selected items as an example.

I think you are struggling with a web block event/trigger.


Please let us know

Sample.oml

mvp_badge
MVP

Hi Jahnavi,

I think this is related to your previous  you will need to save data of sublist and main list in entity where you have option of main list inside sub list.

you need to loop for that .

can you share oml.


Regards

Rahul Sahu

Rahul Sahu wrote:

Hi Jahnavi,

I think this is related to your previous  you will need to save data of sublist and main list in entity where you have option of main list inside sub list.

you need to loop for that .

can you share oml.


Regards

Rahul Sahu

 

 I have attached my oml here. When I select multiple checkboxes those values should be added to selectedList in database. Can you please help me in solving this issue.

Sample.oml


Hi Jahnavi..

I guess it would be better that you select all the required files at once. Then using a for each loop, iterate through all the values and append those whose IsSelected is True. Also I don't think that you can normally save the selected list in a string format like the way you have done. You can use JSON-Serialize option. Just the thing is that you will have to fetch the data with the help of JSON_Deserialize. 


I have attached an OML. Hope this helps as a possible solution....

SampleSolution.oml

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