cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
atagios
Frequent Visitor

Create a collection with the Defaults of a SharePoint list plus a new Boolean colum

Hi

I trying to figure out the following:

Create a collection with the Defaults of a SharePoint list plus a new Boolean column.

 

Eg Collection creation: ClearCollect(ColWeekPrjHoursLine,Defaults(WeeksPrjHours));

 

And to this collection add a new column “LineBtnSave” type Boolean

 

I have tried modifying the collection creation command as follows:

ClearCollect(ColWeekPrjHoursLine,AddColumns(Defaults(WeeksPrjHours)," LineBtnSave ",true));

 

But this way I get an error that “The function ‘AddColumns’ has some invalid arguments”

Can someone help me with this?

Thanks

Andreas

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @atagios 

The defaults function returns the record. Therefore in this case, you would call patch, rather than AddColumns. The formula you would use would look like this.

ClearCollect(ColWeekPrjHoursLine,
             Patch(Defaults(WeeksPrjHours),{LineBtnSave:true})
)

This will add the column LineBtnSave, with a value of true.

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @atagios 

The defaults function returns the record. Therefore in this case, you would call patch, rather than AddColumns. The formula you would use would look like this.

ClearCollect(ColWeekPrjHoursLine,
             Patch(Defaults(WeeksPrjHours),{LineBtnSave:true})
)

This will add the column LineBtnSave, with a value of true.

atagios
Frequent Visitor

Hi @timl 

Thank you, It worked!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,339)