AddColumns(Table, ColumnName, Formula [, ColumnName2, Formula2, ...])
- Table: The original table to which you want to add new columns.
- ColumnName: The name of the new column you want to add.
- Formula: The calculation or expression that will determine the values in the new column.
- (Optional) You can add multiple columns by specifying additional pairs of column names and formulas.
Using AddColumns to add a new column
As you can see, we have a collection named colStudents, which contains student records.

Collect(
 colStudents,
 {
   'First Name': "Sanjay ",
   'Last Name': "Singh",
   'Cource Code': 586,
   Course: "Bio Tech",
   'Enroll Date': DateValue("2020-09-01")
 },
 {
   'First Name': "Manoj ",
   'Last Name': "Rana",
   'Cource Code': 510,
   Course: "Computer Science",
   'Enroll Date': DateValue("2021-08-15")
 },
 {
   'First Name': "Pratap",
   'Last Name': "Aggarwal",
   'Cource Code': 589,
   Course: "Mathematics",
   'Enroll Date': DateValue("2022-02-10")
 }
)

Collect( Â colStudentDetails, Â AddColumns( Â Â Â colStudents, Â Â Â FullName, Â Â Â 'First Name' & " " & 'Last Name' Â ) )
colStudentsUpdated: The new collection with the newly added column.
AddColumns: This adds the new column.
colStudents: This is the existing collection.
FullName: The new column being added.
‘First Name’ & ” ” &Â ‘Last Name’: To concatenate First Name and Last Name to create the FullName.

Using AddColumns function to add multiple columns
ClearCollect( Â colStudentDetails, Â AddColumns( Â Â Â colStudents, Â Â Â FullName, Â Â Â 'First Name' & " " & 'Last Name', Â Â Â 'Course Duration', Â Â Â If( Â Â Â Â Â 'Cource Code' = 586, Â Â Â Â Â "6 Months", Â Â Â Â Â 'Cource Code' >= 510, Â Â Â Â Â "1 Year", Â Â Â Â Â "2 Year" Â Â Â ) Â ) )
ClearCollect: This creates or clears and then fills the colStudentDetailscollection with the result of the AddColumns function.
AddColumns: Adds two new columns to the colStudents collection.
FullName: Concatenates ‘First Name’ and ‘Last Name’.
Course Duration: Uses an If condition to determine the course duration based on the Course Code.
Now, click on the AddColumns button, and you will see that a new collection named colStudentDetails is created, which includes the newly added columns called FullName, and Course Duration.

Recommended for you..
![]()
