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

Pad records to collection

Heyo everyone.

I'd like to pad records to collection until they reach a certain number, such as 10. If I start off my single-column collection with 4 records, I want 6 blank records to be added. If I start with 9, one is added, etc. I can't figure out how to do it.

 

I would be grateful if someone could help me with this

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Pad records to collection

@johnbchron 

Here’s how to do it:

 

ForAll(Sequence(10- CountRows(colYourCollectionName)),

Patch(colYourCollectionName, Defaults(colYourCollectionName), {Value: Blank()}))

 

My assumption is your collection name is colYourCollectionName with a single column called Value.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

1 REPLY 1
Highlighted
Super User
Super User

Re: Pad records to collection

@johnbchron 

Here’s how to do it:

 

ForAll(Sequence(10- CountRows(colYourCollectionName)),

Patch(colYourCollectionName, Defaults(colYourCollectionName), {Value: Blank()}))

 

My assumption is your collection name is colYourCollectionName with a single column called Value.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,308)