I have the following command which gives the output I want. But I need an expandable version. I know that I need to use \seq_map_function:NN
but I don't manage to pass the external argument correctly.
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\seq_new:N \l_uf_outer_seq \seq_set_from_clist:Nn \l_uf_outer_seq {key1,key2,key3}
\prop_new:N \l_uf_a_prop
\prop_put:Nnn \l_uf_a_prop {key1}{aa}
\prop_put:Nnn \l_uf_a_prop {key2}{ab}
\prop_put:Nnn \l_uf_a_prop {keyX}{XX}
\prop_new:N \l_uf_b_prop
\prop_put:Nnn \l_uf_b_prop {key1}{ba}
\prop_put:Nnn \l_uf_b_prop {key3}{bb}
\cs_new:Nn \uf_handle_prop:n
{
\seq_map_inline:Nn \l_uf_outer_seq
{
\prop_if_in:cnT {l_uf_#1_prop} { ##1 } { \prop_item:cn{l_uf_#1_prop}{##1} \par }
}
}
\uf_handle_prop:n {a}
\cs_new:Nn \uf_handle_prop_exp:n
{
???
}
\tl_set:Nx \l_tmpa_tl { \uf_handle_prop_exp:n {a} }
\ExplSyntaxOff
\end{document}