I have set up a database structure for projects and people. The aim is to have the IDs of the people as a value stored in a column of the project database. Now I would like to refer to the people, whose information is stored in a different database.


I was able to get the desired information using \DTLgetvalue. This works now fine for one entry in pi. But how can I loop through all of the entries stored in pi? My attempt with clist_map_inline fails.



% ===== people database setup =======
\NewDocumentCommand{\crcPersonEntry}{ m m }{

% ===== project database setup
\NewDocumentCommand{\crcProjectEntry}{ m m }{

% Use: \getProject{<id>}

\clist_map_inline:Nn {#1}{%



  name={My Project},
  pi={person1, person2}
  name={My other Project},




%\getProject{project1} % --> My Project, Peter Perssonos, Agnes Holgersson

\getProject{project2} % -> My other Project, Paula Ickstein


That is the current result.

enter image description here

  • Try printing out thePIList just before the clist_map_inline command to see what are the content/catcode.
    – user202729
    Mar 23, 2022 at 16:48
  • I get the content of the key "pi", e.g. 'person1, person2' or 'person3'. So it seems the content is passed correctly to the macro "\getPIs". Any suggestions how to solve it? Mar 23, 2022 at 19:00
  • So if you already have the value person3 how would you manually "loop through the values"? (I'm not familiar with datatool)
    – user202729
    Mar 23, 2022 at 19:15
  • Using \tl_analysis_show:n for the argument of \getPIs I get: The token list contains the tokens: > \thePIlist (control sequence=macro:->person1, person2).. Looping through the values is only necessary when I have more than one value (e.g. person1, person2 in the database project1. In that case the names of the people behind person1 and person2 should be printed. Mar 23, 2022 at 19:19
  • Try printing out the ##1 (don't run datatool to get the name yet, just print out ##1) to see whether the clist is parsed correctly.
    – user202729
    Mar 23, 2022 at 19:22


You must log in to answer this question.

Browse other questions tagged .