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

Notifications

Announcements

Community site session details

Community site session details

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard