Forum Discussion

mrarkapravo's avatar
mrarkapravo
Contributor
4 years ago
Solved

how delete multiple generated ids one by one using delete endpoint

I am creating 5 records using Post end points, then after creating those ids I want to delete them one by one using delete end point just for clean up , so how can I achieve it?

 

So here, I cannot delete multiple IDs in a single request.

 

While creating the records, storing them in a property as object as below-

{"id1":"124","id2":"234","id3":"345" }

 

Tried it with groovy, where I am reading those IDs from the property using "Data Source" and then trying to use them for delete using loop, but problem is the loop is going infinitive and for delete always taking only 1st ID i.e "id1":"124".

It would be great if anyone can give me solution .

 

19 Replies

    • richie's avatar
      richie
      Community Hero
      Hey mrarkapravo,

      You dont need groovy to do this.

      You can use dataSource loop to handle this. Om typing this on my phone, but i'll provide basic test step hierarchy with explanation when on my laptop

      Cheers

      Rich
      • mrarkapravo's avatar
        mrarkapravo
        Contributor

        Hi richie ,

         

        Thank you for your reply ,could you please explain ?

        dataSource loop use to loop from and to, but how will it help to loop in picking IDs one by one from property (here I am storing the generated ids as key and value pair as explained above) and send it to delete endpoint?

  • Holden's avatar
    Holden
    Occasional Visitor

    Thanks for this post i was willing to post it and i found this I am creating 4 records using Post end points and i had the same question.

    Myloweslife