Merge local list and aggregate list together in a single table record

Hi,

I need to display a single table record from a local list containing the files uploaded currently and an aggregate list  containing the files in db. So, whenever an employee adds files it should show both the existing and currently uploaded files in a single table records(or)list records.

Solution

Hi Balaji,


I just referred the shared .oml file and I think that by doing some code changes you can achieve what you required off.


1) Introduce a ListAppendAll server action node within the Preparation Action flow as mentioned below:


2) Within the OnNotify screen action flow introduce the below code changes:

     i. Introduce a ListAppendAll server action node, which will append the existing List Of Record (i.e. Var2) with the DeserializedOutput List

     ii. Disable the assignment operator

3) Adding to that, remove the below UI section; which is no more needed.



Hope this helps you!


Regards,

Benjith Sam

Solution

Benjith Sam wrote:

Hi Balaji,


I just referred the shared .oml file and I think that by doing some code changes you can achieve what you required off.


1) Introduce a ListAppendAll server action node within the Preparation Action flow as mentioned below:


2) Within the OnNotify screen action flow introduce the below code changes:

     i. Introduce a ListAppendAll server action node, which will append the existing List Of Record (i.e. Var2) with the DeserializedOutput List

     ii. Disable the assignment operator

3) Adding to that, remove the below UI section; which is no more needed.



Hope this helps you!


Regards,

Benjith Sam


Hi Benjith Sam,

Thanks for this and it's what I've expected but when I add a new file existing files are created again and I've attached an image with it for your reference.

Hi Balaji,

Please check whether you are having the same duplicate record (mentioned in the screen-shot) stored in the database table (i.e. EmployeeFile) either by debugging the Preparation action flow (check the GetEmployeeFilesByFileId Aggregate Output List) or by viewing the data of EmployeeFile Entity. If that's is not the case then please share with me the latest .oml file after done with the latest code changes.


Regards,

Benjith Sam

Benjith Sam wrote:

Hi Balaji,

Please check whether you are having the same duplicate record (mentioned in the screen-shot) stored in the database table (i.e. EmployeeFile) either by debugging the Preparation action flow (check the GetEmployeeFilesByFileId Aggregate Output List) or by viewing the data of EmployeeFile Entity. If that's is not the case then please share with me the latest .oml file after done with the latest code changes.


Regards,

Benjith Sam


Hi Benjith, 

Yeah actually I've creating duplicates since I've given FileId value to be null identifier. So in save logic , I've used a if To check whether the record is already present in the db or not. if not create the file. So I've achieved what i want to do it. Thanks for your precious time. Also I've attached the oml for your reference.

Balaji Vinayagamoorthi wrote:

Benjith Sam wrote:

Hi Balaji,

Please check whether you are having the same duplicate record (mentioned in the screen-shot) stored in the database table (i.e. EmployeeFile) either by debugging the Preparation action flow (check the GetEmployeeFilesByFileId Aggregate Output List) or by viewing the data of EmployeeFile Entity. If that's is not the case then please share with me the latest .oml file after done with the latest code changes.


Regards,

Benjith Sam


Hi Benjith, 

Yeah actually I've creating duplicates since I've given FileId value to be null identifier. So in save logic , I've used a if To check whether the record is already present in the db or not. if not create the file. So I've achieved what i want to do it. Thanks for your precious time.


I'm glad I was able to help :)


Regards,

Benjith Sam

Benjith Sam wrote:

Balaji Vinayagamoorthi wrote:

Benjith Sam wrote:

Hi Balaji,

Please check whether you are having the same duplicate record (mentioned in the screen-shot) stored in the database table (i.e. EmployeeFile) either by debugging the Preparation action flow (check the GetEmployeeFilesByFileId Aggregate Output List) or by viewing the data of EmployeeFile Entity. If that's is not the case then please share with me the latest .oml file after done with the latest code changes.


Regards,

Benjith Sam


Hi Benjith, 

Yeah actually I've creating duplicates since I've given FileId value to be null identifier. So in save logic , I've used a if To check whether the record is already present in the db or not. if not create the file. So I've achieved what i want to do it. Thanks for your precious time.


I'm glad I was able to help :)


Regards,

Benjith Sam

Hey Benjith,

    It looks like its still duplicating and you can see my oml file attached in above post for your reference.


Hi Balaji,


As per my observation, the code looks correct to me. 

1) Is the Employee File List Table Record is showing duplicate record at the first screen load?

2) Is the duplication of record is occurring after the user upload the Profile picture? 

if it so, then it happened because, the User Profile upload button widget is set as Submit method (Screen will get PostBack) it means the preparation action flow will get executed once again, during which the List will get append with the previous list record. (you can introduce the ListClear node (to clear the var2 List) at the beginning of the Preparation action flow)  

3) If the above case is not valid, then I doubt duplicity in the db table record. 


Regards,

Benjith Sam

Benjith Sam wrote:

Hi Balaji,


As per my observation, the code looks correct to me. 

1) Is the Employee File List Table Record is showing duplicate record at the first screen load?

2) Is the duplication of record is occurring after the user upload the Profile picture? 

if it so, then it happened because, the User Profile upload button widget is set as Submit method (Screen will get PostBack) it means the preparation action flow will get executed once again, during which the List will get append with the previous list record. (you can introduce the ListClear node (to clear the var2 List) at the beginning of the Preparation action flow)  

3) If the above case is not valid, then I doubt duplicity in the db table record. 


Regards,

Benjith Sam

Okay let me try it and let you know. Thanks for your help.


Benjith Sam wrote:

Hi Balaji,


As per my observation, the code looks correct to me. 

1) Is the Employee File List Table Record is showing duplicate record at the first screen load?

2) Is the duplication of record is occurring after the user upload the Profile picture? 

if it so, then it happened because, the User Profile upload button widget is set as Submit method (Screen will get PostBack) it means the preparation action flow will get executed once again, during which the List will get append with the previous list record. (you can introduce the ListClear node (to clear the var2 List) at the beginning of the Preparation action flow)  

3) If the above case is not valid, then I doubt duplicity in the db table record. 


Regards,

Benjith Sam

As you can see in the image fileid 2 & 3 are being created again 


Balaji Vinayagamoorthi wrote:

Benjith Sam wrote:

Hi Balaji,


As per my observation, the code looks correct to me. 

1) Is the Employee File List Table Record is showing duplicate record at the first screen load?

2) Is the duplication of record is occurring after the user upload the Profile picture? 

if it so, then it happened because, the User Profile upload button widget is set as Submit method (Screen will get PostBack) it means the preparation action flow will get executed once again, during which the List will get append with the previous list record. (you can introduce the ListClear node (to clear the var2 List) at the beginning of the Preparation action flow)  

3) If the above case is not valid, then I doubt duplicity in the db table record. 


Regards,

Benjith Sam

Okay let me try it and let you know. Thanks for your help.



It looks like there is a problem in my save logic since I've to compare the list with data that is already present in the database.