Workflow Soluiton

 View Only
  • 1.  Advanced Excel sheet validation in Workflow

    Posted Aug 31, 2011 09:11 AM

    Hi.

    I'm letting users upload a pre-formatted Excel sheet into my workflow. This file/sheet has 35 columns. Columns contain information about a computer: col1 = MAC, col2=VLAN, col3=Computer name etc. The users should not change the order of the columns. Should not. But can.

    I'm using Workflow solutions 7.0. I read this Excel file into a variable using a custom integration library (Create Integration / Microsoft / Excel...). Since I'm using a "ready-to-use" excel integration from symantec, there are some limitations, for example if user changes the order of columns in the file and uploads it, the whole things goes wrong (custom library doesn't notice that column headers in excel file are different from the ones defined in the integration library.

     

    So I need to validate the following after the excel file has been updated:

    - the columns (1st rows headers) in the excel file are in the same order as the column names expected in the custom integration library (or wrong data get inserted into wrong columns in the variable)

    - also columns 1(MAC), 5(Building code etc), 9, 13, 20 and 27 on each row contain data.

     

    What would be the smart, automated way to do this?

    I have though of validating the headers with 35 separate text equals components, and validating the cells on each row with 6 additional text equals components, but that feels very clumsy. And needs constant watching over.

     

     

    Thanks for any ideas.

    Mike



  • 2.  RE: Advanced Excel sheet validation in Workflow
    Best Answer

    Posted Sep 01, 2011 05:27 AM

    I'm not sure if I understand well what you exactly expect.

    1) Define a string collection containing header names in proper order. Not a bed idea is reading these values from custom XML file that can be easily done by Read Object From XML component.

    Further I propose two options:

    2a) If you only need to know if column order is OK, you can build a single string from heder names read from Excel seperated by a special character using Build Text From Elements and comparing it with string built in the same way from your predefined collection.

    2b) If you need more specific info where the problem occured build a string collection from header names read from Excel and compare it with predefined collection. Comparing can by done in many ways: using Customizable Collection Filter, using one or two nested For Each Element in Collection.

    In both cases you must manually add all 35 attributes with header names but only in one single component.



  • 3.  RE: Advanced Excel sheet validation in Workflow

    Posted Sep 02, 2011 07:39 AM

    Your plan 2b does what I want. Thanks for the help!

    -Mike