cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Trying to "Insert" in a collection index.

I am trying to do what would appear to be an "InsertRow" in a collection.  

 

I have a column PickID which is an incremental index.  I want to renumber "+1" starting at a particular number CurrentPickID.  I cannot seem to get the command just right.  I think the command itself explains what I'm trying to do, but I need some help doing it.  

 

ForAll(Patch(Filter(PickHistory,PickID>CurrentPickID),LookUp(PickHistory,PickID=PickID,{PickID:PickID+1})))

image.png 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Trying to "Insert" in a collection index.

The ForAll() can't update the subject table of the ForAll(). However there maybe a different that will work for you in this case. Give this a try:
 
UpdateIf(PickHistory, PickID>CurrentPickID, {PickID:PickID+1})



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Trying to "Insert" in a collection index.

The ForAll() can't update the subject table of the ForAll(). However there maybe a different that will work for you in this case. Give this a try:
 
UpdateIf(PickHistory, PickID>CurrentPickID, {PickID:PickID+1})



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Super User
Super User

Re: Trying to "Insert" in a collection index.

Perfect!!  Thanks much.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,418)