web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to keep the first ...
Power Apps
Answered

How to keep the first item in the collection?

(0) ShareShare
ReportReport
Posted on by 492
I have a gallery with repeating rows, and I want to keep the first row when users delete other rows.
 
add button on select syntax : 
// Add a new row
Collect(Col_AccessForm, {
    'Source System Name': TextInput2.Text,
    'Source IP-Address': TextInput2_2.Text,
    'Destination System Name': TextInput2_3.Text,
    'Destination IP-Address': TextInput2_4.Text,
    'Destination Port/s': TextInput2_5.Text,
    'VPN/Lease': TextInput2_6.Text
});
 
// Debugging: Display the contents of Col_AccessForm
Label1.Text = First(Col_AccessForm).'Source System Name';
Label2.Text = First(Col_AccessForm).'Source IP-Address';
Label3.Text = First(Col_AccessForm).'Destination System Name';
Label4.Text = First(Col_AccessForm).'Destination IP-Address';
Label5.Text = First(Col_AccessForm).'Destination Port/s';
Label6.Text = First(Col_AccessForm).'VPN/Lease';
 
Gallery Item syntax: Col_AccessForm
 
The trash can icon OnSelect: Remove(Col_AccessForm, LastN(Col_AccessForm,1)
 
 
How can I achieve this?
 
Categories:
I have the same question (0)
  • Verified answer
    NN-21081740-0 Profile Picture
    492 on at
    I managed to come up with the solution:
     
    I thought of disabling the trash can icon when there's only one row left and BOOM!
     
    So in the Display Mode properties of the trash can I added :
     
    If(CountRows(Col_NetworkForm)=1, DisplayMode.Disabled)
     
    💃💃💃💃

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 408

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 319

Last 30 days Overall leaderboard