Data360 Analyze

 View Only
  • 1.  Create a dropdown menu in an excel column

    Posted 10-03-2024 12:30

    I'm looking to see if something is possible. I was not able to find anything through the search. I'm creating a column through a transform node and looking to make it a dropdown (data validation list). Using the transform node I created a new column under the configure fields:

    out1 += in1
    out1.Issue_Owner = str
    and then using this code in the processrecords:
    dropdown_options = [
        'Resale', 'Sales', 'Care', 'LSPAC', 'Remaining Services', 'OP',
        'Repair', 'Offline Support', 'Translations'
    ]

    out1.Issue_Owner = dropdown_options

    This is not working due to it looking for a single input instead of a list. Is this something possible or am I chasing my tail?
    Thanks!

     



    ------------------------------
    Trent Karr
    Knowledge Community Shared Account
    Burlington MA
    ------------------------------


  • 2.  RE: Create a dropdown menu in an excel column

    Employee
    Posted 10-04-2024 09:11

    If you want to store a list object in a string field, you will need to serialize it.

    You could use the Python repr() function for this. 

    out1.Issue_Owner = repr(dropdown_options)

    Then when you need that value later on in Python code, use the eval() function:

    dropdown_options = eval(in1.Issue_Owner)  

    And I've found the json library's json.dumps() and json.loads() is much faster than the repr(), eval() combination.

    Ernest



    ------------------------------
    Ernest Jones
    Precisely Software Inc.
    PEARL RIVER NY
    ------------------------------