<?xml version="1.0"?>
<AlteryxDocument yxmdVer="2022.1">
  <Nodes>
    <Node ToolID="1">
      <GuiSettings Plugin="AlteryxGuiToolkit.TextBox.TextBox">
        <Position x="54" y="18" width="810" height="220" />
      </GuiSettings>
      <Properties>
        <Configuration>
          <Text><![CDATA[Convert a folder of .yxdb files to CSV (for PlaidCloud import)

Run this workflow in Alteryx Designer to rewrite every .yxdb in a folder as a CSV file that
PlaidCloud can import directly. Before running, make three edits:

1. Directory tool - set the folder that holds your .yxdb files.
2. Dynamic Input tool - point the Input Data Source Template at any ONE .yxdb file in that
   folder (it defines the field layout for the batch).
3. Output Data tool - set the output folder. Files are written as converted_<name>.csv.

IMPORTANT: the Dynamic Input tool requires every file in the batch to share the template's
field layout. Files with a different layout are skipped with a warning - group those into
their own folder (with their own template) and run again, or re-save them individually.

Guide: https://docs.plaidcloud.com/guides/workflows/convert-yxdb-files-for-import/]]></Text>
          <Font name="Segoe UI" size="10" style="0" />
          <TextColor name="Black" />
          <FillColor name="White" />
          <Shape shape="0" />
          <Justification Justification="0" />
        </Configuration>
        <Annotation DisplayMode="0">
          <Name />
          <DefaultAnnotationText />
          <Left value="False" />
        </Annotation>
      </Properties>
    </Node>
    <Node ToolID="2">
      <GuiSettings Plugin="AlteryxBasePluginsGui.Directory.Directory">
        <Position x="54" y="306" />
      </GuiSettings>
      <Properties>
        <Configuration>
          <Directory>C:\yxdb_conversion\input</Directory>
          <FileSpec>*.yxdb</FileSpec>
          <IncludeSubDirs value="False" />
        </Configuration>
        <Annotation DisplayMode="0">
          <Name />
          <AnnotationText>1. Set this to the folder holding your .yxdb files</AnnotationText>
          <DefaultAnnotationText />
          <Left value="False" />
        </Annotation>
      </Properties>
      <EngineSettings EngineDll="AlteryxBasePluginsEngine.dll" EngineDllEntryPoint="AlteryxDirectory" />
    </Node>
    <Node ToolID="3">
      <GuiSettings Plugin="AlteryxBasePluginsGui.DynamicInput.DynamicInput">
        <Position x="198" y="306" />
      </GuiSettings>
      <Properties>
        <Configuration>
          <InputConfiguration>
            <Configuration>
              <Passwords />
              <File OutputFileName="FileName" RecordLimit="" SearchSubDirs="False" FileFormat="19">C:\yxdb_conversion\input\template.yxdb</File>
              <FormatSpecificOptions />
            </Configuration>
          </InputConfiguration>
          <Mode>ReadList</Mode>
          <ReadList_Field>FullPath</ReadList_Field>
          <ReadList_Type>Path</ReadList_Type>
        </Configuration>
        <Annotation DisplayMode="0">
          <Name />
          <AnnotationText>2. Point the template at any ONE .yxdb in the folder</AnnotationText>
          <DefaultAnnotationText />
          <Left value="False" />
        </Annotation>
      </Properties>
      <EngineSettings EngineDll="AlteryxBasePluginsEngine.dll" EngineDllEntryPoint="AlteryxDynamicInput" />
    </Node>
    <Node ToolID="4">
      <GuiSettings Plugin="AlteryxBasePluginsGui.Formula.Formula">
        <Position x="342" y="306" />
      </GuiSettings>
      <Properties>
        <Configuration>
          <FormulaFields>
            <FormulaField expression="REGEX_REPLACE(REGEX_REPLACE([FileName], '.*[\\/]', ''), '(?i)\.yxdb$', '')" field="SourceFileName" size="254" type="V_WString" />
          </FormulaFields>
        </Configuration>
        <Annotation DisplayMode="0">
          <Name />
          <AnnotationText>Base file name (drives the output CSV name)</AnnotationText>
          <DefaultAnnotationText />
          <Left value="False" />
        </Annotation>
      </Properties>
      <EngineSettings EngineDll="AlteryxBasePluginsEngine.dll" EngineDllEntryPoint="AlteryxFormula" />
    </Node>
    <Node ToolID="5">
      <GuiSettings Plugin="AlteryxBasePluginsGui.AlteryxSelect.AlteryxSelect">
        <Position x="486" y="306" />
      </GuiSettings>
      <Properties>
        <Configuration>
          <OrderChanged value="False" />
          <CommaDecimal value="False" />
          <SelectFields>
            <SelectField field="FileName" selected="False" />
            <SelectField field="*Unknown" selected="True" />
          </SelectFields>
        </Configuration>
        <Annotation DisplayMode="0">
          <Name />
          <AnnotationText>Drop the FileName helper column</AnnotationText>
          <DefaultAnnotationText />
          <Left value="False" />
        </Annotation>
      </Properties>
      <EngineSettings EngineDll="AlteryxBasePluginsEngine.dll" EngineDllEntryPoint="AlteryxSelect" />
    </Node>
    <Node ToolID="6">
      <GuiSettings Plugin="AlteryxBasePluginsGui.DbFileOutput.DbFileOutput">
        <Position x="630" y="306" />
      </GuiSettings>
      <Properties>
        <Configuration>
          <File MaxRecords="" FileFormat="0">C:\yxdb_conversion\output\converted_.csv</File>
          <Passwords />
          <FormatSpecificOptions>
            <LineEndStyle>CRLF</LineEndStyle>
            <Delimeter>,</Delimeter>
            <ForceQuotes>False</ForceQuotes>
            <HeaderRow>True</HeaderRow>
            <CodePage>65001</CodePage>
            <WriteBOM>True</WriteBOM>
          </FormatSpecificOptions>
          <MultiFile value="True" />
          <MultiFileType>Suffix</MultiFileType>
          <MultiFileField>SourceFileName</MultiFileField>
          <KeepField value="False" />
        </Configuration>
        <Annotation DisplayMode="0">
          <Name />
          <AnnotationText>3. Set the output folder; writes converted_&lt;name&gt;.csv per file</AnnotationText>
          <DefaultAnnotationText />
          <Left value="False" />
        </Annotation>
      </Properties>
      <EngineSettings EngineDll="AlteryxBasePluginsEngine.dll" EngineDllEntryPoint="AlteryxDbFileOutput" />
    </Node>
  </Nodes>
  <Connections>
    <Connection>
      <Origin ToolID="2" Connection="Output" />
      <Destination ToolID="3" Connection="Input" />
    </Connection>
    <Connection>
      <Origin ToolID="3" Connection="Output" />
      <Destination ToolID="4" Connection="Input" />
    </Connection>
    <Connection>
      <Origin ToolID="4" Connection="Output" />
      <Destination ToolID="5" Connection="Input" />
    </Connection>
    <Connection>
      <Origin ToolID="5" Connection="Output" />
      <Destination ToolID="6" Connection="Input" />
    </Connection>
  </Connections>
  <Properties>
    <Memory default="True" />
    <GlobalRecordLimit value="0" />
    <TempFiles default="True" />
    <Annotation on="True" includeToolName="False" />
    <ConvErrorLimit value="10" />
    <ConvErrorLimit_Stop value="False" />
    <CancelOnError value="False" />
    <DisableBrowse value="False" />
    <EnablePerformanceProfiling value="False" />
    <DisableAllOutput value="False" />
    <ShowAllMacroMessages value="False" />
    <ShowConnectionStatusIsOn value="True" />
    <ShowConnectionStatusOnlyWhenRunning value="True" />
    <ZoomLevel value="0" />
    <LayoutType>Horizontal</LayoutType>
    <MetaInfo>
      <NameIsFileName value="True" />
      <Name>convert_yxdb_folder</Name>
      <Description>Batch-convert a folder of .yxdb files to CSV for import into PlaidCloud.</Description>
      <RootToolName />
      <ToolVersion />
      <ToolInDb value="False" />
      <CategoryName />
      <SearchTags>plaidcloud yxdb csv convert migration</SearchTags>
      <Author>PlaidCloud</Author>
      <Company>PlaidCloud, Inc.</Company>
      <Copyright />
      <DescriptionLink actual="" displayed="" />
      <Example>
        <Description />
        <File />
      </Example>
    </MetaInfo>
    <Events>
      <Enabled value="True" />
    </Events>
  </Properties>
</AlteryxDocument>
