How dynamic array response verified

Hi All,
I want to verify my response in dynamic way, Response is basically in array format and array value gonna be change everytime.
Note: I am following data driven approach with .csv file so data already upto date in .csv file with queries.

response:
[ {
“id”: 7593401,
“orderNumber”: “32051746”
},
{
“id”: 7593401,
“orderNumber”: “29904051”,

}

]
OR
Repsonse:
[ {
“id”: 7593401,
“orderNumber”: “32051746”
}
]
You can see array response change ,who we can assert in Tests area in Postman?

.CSV file:

Hi,
You can save first response as stringify Json variable. And after second request compare them.

First Request
var req = pm.response.json();
pm.collectionVariables.set('XYZ_Model', JSON.stringify(req));
Second Request compare as string
const fReq= pm.collectionVariables.get("XYZ_Model")
var req = pm.response.json();

pm.expect(fReq).to.equal(JSON.stringify(req)) ; 

Second Request compare as objects
const fReq= pm.collectionVariables.get("XYZ_Model")
var req = pm.response.json();

pm.expect( JSON.parse(fReq)).to.deep.equal(req) ; 

This is the simplest approach.

When data in response may change?

If you are new, please seek help in the #just-getting-started topic.

Not fully understand, Any suggested links?
@allenheltondev Anything do you have?

I don’t fully understand your problem.

Is the API you a hitting using values from your csv in the request? I don’t know what you’re trying to verify. Screenshots of the request and what you’re trying to test would be helpful.

If you see my response, Always Array values different based on the input so how I can write my optimized script?And how I can arrange my data in .csv file?
P.S. I am verifying response data through .csv file.


Let me know still need further update.

In an ideal scenario, what would happen here? I don’t understand what your request is doing.

Are you sending a request with params from your csv, then using other params in the csv to validate the response?

Do you need to find a specific object in the response array and validate it? Do you need to validate all of them? Just the first one?