cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Reordering column

Hi,

I have SharePoint list StepsInProcess with column Order in which I set numbers from 1 to N depends on how much steps parent list Process have. I use gallery to filter all steps which belongs to selected Process. When user delete one step from gallery I want to reorder my list StepsInProces, column Order, with number of Row in gallery. (before user delete one step in list StepsInProcess, Order column has, for example this order number: 1,2,3,4,5, after User delete for instance Step with Order column: 3, my new gallery/list have this order column values: 1,2,4,5 and I want to be: 1,2,3,4) 

 

I try everything with ForAll and Patch but I did not find solution.

 

Please help me...  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: Reordering column

Hi @mdevaney 

 

We find right solution which combine solution from your link and ours...

 

ClearCollect(colKoraci, SortByColumns(Filter(KorakUProcesu, IDProcesa = glrProcesiSP.Selected.ID),"Redosled" , Ascending));
Clear(colBrojac);
ForAll(colKoraci, 
       Collect(colBrojac,
               Last(FirstN(AddColumns(colKoraci,
                                "RowNumber",
                                CountRows(colBrojac)+1
                           ), 
                           CountRows(colBrojac)+1
                    )
               )    
       )
);
ForAll(
    glrKoraciProcesa_sIP.AllItems,
    UpdateIf(
        KorakUProcesu,
        ID = Value(Label6.Text),
        {Redosled: Value(Label11.Text)}
    )
)

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Reordering column

@Gidrone_NS
From what I know maintaining a continuous set of IDs would require you to create a new row numbers column after each gallery item is deleted. Here’s a link to a blog article showing how to make the column showing row number. It’s quite an interesting technique.

http://powerappsguide.com/blog/post/generating-row-numbers
Highlighted
Advocate II
Advocate II

Re: Reordering column

Hi @mdevaney 

 

We find right solution which combine solution from your link and ours...

 

ClearCollect(colKoraci, SortByColumns(Filter(KorakUProcesu, IDProcesa = glrProcesiSP.Selected.ID),"Redosled" , Ascending));
Clear(colBrojac);
ForAll(colKoraci, 
       Collect(colBrojac,
               Last(FirstN(AddColumns(colKoraci,
                                "RowNumber",
                                CountRows(colBrojac)+1
                           ), 
                           CountRows(colBrojac)+1
                    )
               )    
       )
);
ForAll(
    glrKoraciProcesa_sIP.AllItems,
    UpdateIf(
        KorakUProcesu,
        ID = Value(Label6.Text),
        {Redosled: Value(Label11.Text)}
    )
)

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

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,509)