Search Results for

    Show / Hide Table of Contents

    Working with Python Flow Node Scripts

    In this code sample we will show how to read and output data from the database with a Python Script in the FLow Node System.

    Required Modules

    • Simplic.Flow
      • DataPinScope
      • IFlowRuntimeService
      • ActionNode
    • simplic
      • Sql

    Samples

    Python

    from simplic import Sql
    
    class PythonFlowNodeScript:
    
        def __init__(self, node):
            self.node = node
    
        def execute(self, runtime, scope):
    
            names = []
            res = Sql.execute("select UserName from ESS_MS_Intern_User")
    
            for ESS_MS_Intern_User in res:
                names.append(ESS_MS_Intern_User.UserName)
    
            scope.SetValue(self.node.OutPinData01, names)
            scope.SetValue(self.node.OutPinData02, res[0].UserName)
    

    Output

    In this sample the output is a list of all usernames (OutPinData01) and after that the first object in the previous list (OutPinData02).
    
    • Improve this Doc
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx