I am trying to run nested foreach loops (outer loop for campaigns and inner loop for adsets) to update record in the database i.e. campaign ID and corresponding adset ID
In the data, there are a total of 3 different campaigns and within each campaign there are either 2 or 3 adsets objects.
Trying to increment variable x1 based on the outer loop but the variable isn't getting updated as expected. At the end of the outer loop run, x1 value should be 3 but what I am getting is 1. What am I missing here?