Question


Cognizant
IN
Last activity: 18 Jun 2025 13:51 EDT
We have a pagelist of 100 entries now we have to Insert a value at 50th record how can we achieve this?
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?
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 18 Jun 2025 13:51 EDT


Capgemini
FR
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!


Capgemini
FR
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)


Capgemini
FR
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?


Altimetrik
IN
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.


Cognizant
IN
@PoojaPalla can we use a DT to do this?
Accepted Solution
Updated: 18 Jun 2025 13:51 EDT


Capgemini
FR
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!