Hey @Pradip_Kumar_Parkar! setValue doesn't work in perfect order, so would something like this work for you?
https://community.retool.com/t/variable1-setvalue-doesnt-work-immediately/25742
Also, we have these docs that should go over async JS in Retool (including setValue)!