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 / Record a new item in t...
Power Apps
Answered

Record a new item in the middle of the list

(0) ShareShare
ReportReport
Posted on by 80

Hi, 

 

i currently have this as I’m adding item to a collection and having a gallery that shows the data of the collection. 

I was wondering if I can make it able to add a new item in the middle of a data. 

 

For example, I’ve been thinking having a drop down that has the number from 1 to # of rows of the collection, and if the user wants to add a new record to the existing data between 1 and 2, click 2 from the dropdown and click ADD, and then make the existing 2 to be 3, and so on. 

 

The issue is that I’m kinda lost and don't know where to start. 

 

Any input will be appreciated, thank you so much! 

 

 

Categories:
  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @pinball2 ,

     

    Do you want to automatically sort by "No" after updating the collection? Maybe you can try this:

     

    Firstly, you can set the items of DropDown:

    vmengmlimsft_0-1691388000021.png

    Second, you can set the OnSelect of Button which can submit a new record like this:

    ForAll(Filter(Gallery1.AllItems,No>=Value(varChoice)),Patch(Collection,ThisRecord,{No:No+1}));
    Patch(Collection,Defaults(Collection),{ No:Value(varChoice), column1:"", column2:""});

    Note: In my test, I set a variable on the OnChange of DropDown to get the choice which is selected:

    Set(varChoice,Self.Selected.No)

    At last, If you want records sorted in ascending order in the Gallery, you can set the items of the Gallery:

    SortByColumns(MyCollection,"No",SortOrder.Ascending)

    Hope this helps you.

     

    Best regards,

    Rimmon Li

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard