Import or export recipes at runtime

Use the RecipeImportExport NetLogic to import recipes from a CSV file or export recipes to a CSV file at runtime.

Prerequisites

Configure a recipes editor

To import or export recipes at runtime
  1. From the toolbar, select Template Libraries.
  2. In Libraries:
    1. Select Scripts.
    2. From the right pane, drag Recipes Import Export to a folder in Project view.
      Drag Recipes Import Export to the Model folder.
    3. Select Close.
  3. In Project view, select the RecipeImportExport object.
  4. In Properties:
    1. In the RecipeSchema property, select the recipe schema of the reference object.
    2. In the CSVFile, enter the full path of the CSV file to import or export.

      C:\temp\export_recipes.csv

      Note: The fields of the CSV file to import must be the same as the database columns.
    3. In the CSVSeparator property, set the CSV delimiter.
    4. To delimit the fields with quotation marks in the CSV file, set the WrapFields property to True.
  5. Configure the buttons to trigger import or export:
    • Add a Button object in a container and associate its MouseClick Event with the NetLogic Import method.
    • Add a Button object in a container and associate its MouseClick Event with the NetLogic Export method.

    For more information, see Button and Add a method to an existing event.

Manage recipes at runtime