PowerApps - Merge Two Collections and Remove Duplicates

One of my Project got a requirement to combine two Collections and Remove the Duplicates while Combining in to a single collection.

For Example i have two Collections,

StudentDetails - Columns StudentID, Name, Age, DateOfBirth

StudentMarks - Columns StudentID, Subject1Marks, Subject2Marks, Subject3Marks

Now I want to merge these two collections without having the Duplicate data. I have used following formulae to combine the two collections into new collection StudentsCollections

With(

   {

      StudentInfo1:

      ShowColumns(

         'StudentDetails', 

         "Name",

         "Age",

         "DateOfBirth"

      ),

      StudentInfo1:

      ShowColumns(

         'StudentMarks', 

         "StudentID", 

         "Subject1Marks",

         "Subject2Marks",

         "Subject3Marks"

      )

   },

   ClearCollect(

      StudentsCollections,

      StudentInfo1,

      Filter(

         StudentInfo2,

         !(StudentID in StudentInfo1.StudentID)

      )

   )

)

Comments

Popular posts from this blog

Linksys Wireless Connection Failure

The security validation for this page is invalid. Click Back in your Web

Access Denied Host Header Sharepoint 2010 Windows Server 2008 R2