We have a pagelist of 100 entries now we have to Insert a value at 50th record of this pagelist how can we achieve this?
Hello,
Just to clarify, you would like to add a new entry in an existing pagelist of 100 entries which will make the pagelist 101 entries, and the old 50th entry (when the pagelist was 100 entries) will become 51th entry (with pagelist of 101 entries)
Hi @TanyaS58
You can try this, to insert a new page at the 50th position in a Page List, loop backward from the last index (e.g., 100) to 50, and shift each page one position forward using Page-Copy. This creates an empty slot at index 50. Then, copy your new page (e.g., TempPage) into .MyPageList(50). This preserves existing data while inserting the new value at the desired position.
@RusselK1 No i would like to add the data in the exisiting 50th entry
@PoojaPalla can we use a DT to do this?
Let’s assume a page list TempPage.pxResults which holds 100 results
If you would like to add a value at the 50th record, you might use Set TempPage.pxResults(50).value equals to “myValue”
Does this helps?
I believe I may have misunderstood your issue.
Here’s how you can proceed. I’ve also attached a snippet for reference.
You declare an integer parameter for the index where you would like to add a new value to your page list, and you declare a temporary page list.
You set your temporary page list with pages from the initial page list up to the 49th index. Next, you add a new page to the temporary page list, and then you append the remaining pages from the initial page list to the temporary list.
Finally, you remove the initial page list and copy the contents of the temporary page list into the initial page list.
Hope this helps!
@RusselK1 Yes this is it,and very clear.Thanks a lot
