Question

Photo of Ken Roach

0

Here's an idea for reporting on Workflows using Dynamic Data Block

How can I list all the attributes and data I have in my workflow?

 

  • Photo of Ken Roach

    0

    This might be superseded by upcoming Workflow reporting functionality, but until then...

    Add the following SQL in your Dynamic Data Block:

    SELECT *
    FROM (
    SELECT  w.[Id],w.[Name],a.[Key],av.[Value]
    FROM    [Workflow] w, [Attribute] a, [Attributevalue] av
    WHERE   w.[Status]='Active' and
            w.[WorkflowtypeId]='24' and
            av.[Entityid]=w.[Id] and
            a.[EntityTypeQualifierValue]=w.[WorkflowTypeId] and
            a.[Id]=av.[AttributeId]
    ) AS t
    PIVOT
    (
      MAX(Value)
      FOR [Key] IN([FirstName],[LastName],[EmailAddress],[Phone],[PhoneMobile],[Elective1],[Elective2],[Elective3],[ElectiveOne],
                [ElectiveTwo],[PaymentReceived],
                [AddressLine1],[Suburb],[City],[PostCode],
                [AgeGroup],[EmergencyContact])
    ) AS p
    ORDER BY [Name];

    Change the '24' to your workflow Id.

    Modify the FOR ... line to specify the Keys of your workflow attributes.

    This will give you one row for each workflow item, with the attributes listed in your FOR clause as columns.

    Right down in the bottom right of the page you will be able to export this to Excel.

     

  • Photo of Brianne Shaw

    0

    This is exactly what we have been looking for. I do have a question regarding the attributes. Some of our attributes are coming over through the GUID format. Is there a way to force the format on the Dynamic Data Block?