Search pulldata

pulldata(‘hh’,‘nidhh’,‘pullid’,concat(${communityid},‘|’,position(…)))

i have this line. i want to make it so when ${communityid} is entered, it searches for an nidhh in hh.csv. there is a pullid 1|1 1|2 1|3 etc. it searches over all combinations, if no nidhh is found, the loop stops. if 2 is entered as ${communityid}, the process starts again. 2|1 2|2.
i know i have to use repeat_count. can’t figure it out.

@od23, would you mind sharing with the community your sample dummy XLSForm and CSV file so that the community could test it out for you and help you out if its possible?

Community HH Harmonization Form 4.6.xlsx (205.8 KB)
agents.csv (204 Bytes)
communities.csv (6.0 KB)
hh.csv (3.4 KB)
the relevant line starts from 24-27.
thanks