cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gidrone_NS
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

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
mdevaney
Super User III
Super User III

@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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (51,764)