Same problem with $['data']['attributes']['flag-2'].*~ that return “Si” instead “1”
and with $['data']['attributes']['flag-1'].*~ that return “No” instead 0 (I think it must return an integer not a string in this case).
First step is to get all the paths of keys type, flag1 and flag2 by using $['data']['attributes']['type'][*] , $['data']['attributes']['flag-1'][*] and $['data']['attributes']['flag-2'][*].
Since this returns a list, convert it to a string by using the Ungroup node. Thereafter you are looking for the last element in the string seperated by []. If you use