Data360 Analyze

Welcome to the Data360 Analyze community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  Renaming columns

    Employee
    Posted 10-04-2017 12:54

    Hi - I am trying to rename a column called 1 using the Transform node with the following script within the ConfigureFields section:

     

    out1.EXTERNAL_ORGANISATIONAL_UNIT_ID = in1.EXTERNAL_ORGANISATION_UNIT_ID
    out1.ATTRIBUTE_1 = in1.[1]

     

    I have lots of differing ways but the same error occurs - what am i doing wrong?

    mismatched input '[' expecting set null Error in "ConfigureFields" at line "5", column "23" in text: out1.ATTRIBUTE_1 = in1.[1]

     

    Many Thanks

    Martin



  • 2.  RE: Renaming columns

    Employee
    Posted 10-05-2017 02:29

    Hi Martin,

    The issue is that the input field specification is a hybrid of two possible formats. Dataverse allows the field metadata to be specified using:

        out1.MyOutputField = in1.FieldName

    where 'FieldName' does not conflict with a Python keyword and does not contain space characters, or

        out1.MyOutputField = in1['Field Name']

    In your situation in1.[1]  should be  in1['1']  - i.e. there is no period '.' character before the opening square bracket. Note also the use of apostrophes around the field name as the field name is a string in this case.

    In addition you can use a variable in the specification, e.g.

        RequiredField = '1'

        out1.MyOutputField = in1[RequiredField]

     

    Best regards,

    Adrian

     



  • 3.  RE: Renaming columns

    Employee
    Posted 10-05-2017 03:58

    You may also be interested in the 'Rename Fields' Community custom node here:

    https://lavastorm.zendesk.com/hc/en-us/community/posts/115001574994-Rename-Fields-Custom-Node