How do I dump my topics' formfields out as XML?

Use the following macros:
  • An outer VarSEARCH or VarFORMAT to iterate over the topics of interest
  • An inner VarFORMAT to iterate over each formfield name
  • The list of formfield names generated by a VarQUERY expression such as
    %QUERY{"'Web.Topic'/fields.name"}%
The following example dumps the formfields from the user topics of users who are members of InfrastructureTaskTeamGroup (inspired by Tasks.Item10935):

%STARTSECTION{"xmlusers"}%<noautolink><literal><?xml version='1.0' encoding='%QUERY{"{Site}{CharSet}"}%'?>
<xml>
%FORMAT{
  "%GROUPINFO{"InfrastructureTaskTeamGroup" separator="," format="$wikiusername"}%"
  web="%USERSWEB%"
  type="topic"
  format="$percntINCLUDE{\"%TOPIC%\" section=\"dotopic\" web=\"$web\" topic=\"$topic\"}$percnt"
}%
</xml></literal></noautolink>%ENDSECTION{"xmlusers"}%

%STARTSECTION{"dotopic"}%%FORMAT{
  "%QUERY{"'%web%.%topic%'/fields.name"}%"
  type="string"
  header="  <topic path='%web%.%topic%'>$n"
  format="    <$item>$percntQUERY{'%web%.%topic%'/$item}$percnt</$item>"
  footer="$n  </topic>"
}%%ENDSECTION{"dotopic"}%

Support.FAQForm edit

TopicClassification FrequentlyAskedQuestion
Subject Data forms, Other...
Topic Summary Demonstrate usage of QUERY and FORMAT to export formfield data in XML
Extension
Interested Parties
Related Topics Tasks.Item10935
Topic revision: r2 - 27 Dec 2011, ArthurClemens
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy