Connector Framework Server 12.11

# Count Sections

For each document, this Lua script adds a total sections count to the title, and replaces the content of each section with the section number.

    function handler(document)
       local section_count = 0;
       local section = document;

       while section do
          section_count = section_count + 1;
          section:setContent("Section "..section_count);
          section = section:getNextSection();
       end

       local title = document:getFieldValue("TITLE");

       if title == nil then title = "" end
       document:setFieldValue("TITLE", title .." Total Sections "
          ..section_count);

       return true;
    end

© Copyright 2022 Micro Focus or one of its affiliates
Version 12.11 | Last updated February 2022

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL Connector Framework Server 12.11

Topic Title: Count Sections