Gatling jsonPath Issue

How I can extract the single user_id for following JSON response

{“success”:true,“data”:{“104795”:[{“user_id”:“104795”,“user_full_name”:"Kapil ",“count_of_payment_instruction_in_specified_status”:203}],“125965”:[{“user_id”:“125965”,“user_full_name”:“fee clerk”,“count_of_payment_instruction_in_specified_status”:20}],“f25e0508-a413-409a-8f93-5fe8ce8bf031”:[{“user_id”:“f25e0508-a413-409a-8f93-5fe8ce8bf031”,“user_full_name”:“SiteSwitch Fee”,“count_of_payment_instruction_in_specified_status”:24}]}}

I tried following jsonPath and that’s giving me expected value 104795 BUT here I need to use value ‘Kapil’ and I don’t want to use it because that’s also dynamic value

$.data.[?(@.user_full_name == ‘Anish feeclerk’)].user_id

I would like to extract either value for user id or value for child i.e., 104795 but this value is same for child and it’s element user_id.

Please can you suggest what’s wrong I am doing here to extract single user_id or all user_ids

Hi Kapil,

Can you please try, below json reg ex.

jsonPath("$.data[?(@.user_full_name == ‘Anish feeclerk’)].user_id).findAll.optional.saveAs(“user_id”)

Mohana Reddy