Hi @mahrukhkhan,
Would you mind going through the discussion that has been discussed earlier. I just checked it and it should work fine. (Please note: you could slightly change it according to your need)
Additionally, you could also have a look over to the support article attached here:
Pull Data () functionality in KoboToolBox
GOOD DAY!