Workflow Soluiton

 View Only
  • 1.  Send Email Question

    Posted Mar 11, 2011 11:01 AM

    I have a project that allows a group of workers to write entries to a database concerning a ticket. It works fairly similar to ServiceDesk / Helpdesk. They can write multiple items to this table that contains a foreign key reference to a master table where I track all other details.

    I need to be able to take all the entries from the table where the ID is equal to the ID of the Job they're currently working on and display those in an email. I have a custom datatype setup but just dragging in those values I feel is going to lead to just a single (the last) entry being shown in the email.

    Perhaps I should look into using a query component to get all the entries and then add them to a collection? Right now I've got it setup (but untested, since we're live) that the information is going to be written to an excel spreadsheet, i'd like to avoid that if i can.



  • 2.  RE: Send Email Question

    Posted Mar 11, 2011 01:50 PM

    Reecardo,

    I'll take a look at this as soon as I can. I already have the query component so that's taken care of.



  • 3.  RE: Send Email Question

    Posted Mar 12, 2011 07:37 PM

    First, I'd write a custom SQL component to get the results I need (SELECT * FROM blah WHERE ID = @id)

    Next, use a Build Text from Elements to make a comma delimited (or new line delimited, you can pick) list from the collection. I think you can do this way, the complex output may present problems. Otherwise, you can loop through the SQL results and use Merge Text to accomplish the same exact thing.

    The 1st Add New Data Element I'm just building a dummy text array of elements {a, b, c, d}. The 2nd Add New Data Element I'm adding an empty text string called workerstring. In For Each Element I'm looping through the array (with an indexer i). In the Merge Text, the Merge looks like "(workerstring)(i)," and I set the output to replace workerstring. This way workerstring builds up. The output at the end should be "a,b,c,d," and you can just trim off the last comma with another component.

    Once the worker string is built, you can just drop it in the email body.