Infoset as Attachment?

 7 Replies
 2 Subscribed to this topic
 14 Subscribed to this forum
Sort:
Author
Messages
thummel1
Veteran Member
Posts: 121
Veteran Member
    Hi, we are on LBI V10. I am looking for a creative way that will allow data to be sent as an email attachment in a smart notification outside of the organization. Ideally, I'd like to convert the data generated from an Info set to an Excel or CSV document, include it in the notification as an attachment versus in the body of the email, and deliver to the recipient.

    All creative ideas are welcome, thanks,

    Tania H

    Dave Curtis
    Veteran Member
    Posts: 136
    Veteran Member
      Personally, when I want to send out an attachment of data I create an LBI report and use a schedule to process and send the data file. LBI has more options for formatting the data etc. Even if you want the report to be built from a Smart Note infoset you can do that since each infoset can be referenced with a SQL query.

      However, if a smart note is sent with a table in the email body it can also include that table as an attachment. Typically they show as ATT00001.xls or something like that but you can save and open the table data in Excel.

      To have smart notes include the table as an attachment, the template you use has to have the reference to what format you want to include.

      For example, the template I am going to attach has a reference near the bottom
      [template=Audit Email Template&type=XLS]

      This is the section that makes the SN send an attachment in XLS format.
      Attachments
      thummel1
      Veteran Member
      Posts: 121
      Veteran Member
        Thank you for your response. Let's say I wanted to use the template you've attached as my format. If I were to create a high level outline of the process, does this capture the steps needed?

        1. Create and save Info Set
        2. Create and save Notification ( designed to trigger when there are new keys).
        3. In Notifications, under Personal Settings, save attached template to our list of templates
        4. In Notifications, under Step 4, tab called 'Formatting Template', click to add this template to the notification and save
        5. When smart note is triggered, the notification will be delivered with the data as an Excel attachment as well as in the body of the email.

        If there are any steps that need tweaking, or added steps needed, feel free to add. I am not familiar with how to create the attached design format, or if it is as simple as using it as-is. If it's something that must be custom designed per each notification, then I will need educate myself on that topic, which I can research independently (unless you have any resources readily available!) Thank you!
        Tania
        Dave Curtis
        Veteran Member
        Posts: 136
        Veteran Member
          Steps to add a new template
          1. Go to Admin menu
          2. Under Content go to Content Administration Tool
          3. Check box for Templates
          4. Click GO
          This should open a list of templates you have. If you are only using the standard, you will see at least “Lawson Default”.
          5. Click Edit next to one of the templates
          This will open the Add/Edit Templates screen
          6. In the Add/Edit Templates screen paste the text from the template I posted into the Enter HTML box.
          7. Give your template a name
          8. Make sure the Embed this template inside another box is blank
          9. At the bottom of the page; check the box for All Device Types
          10. Click on SAVE NEW (make sure it is SAVE NEW so it creates a new one and does not edit the existing one)

          After you create the template you can create your infoset and notification as you normally would. In the Related Info section of the notification, you will go to the Formatting Template tab and you will select the template you created from the Use this template selection box, if you do not see your new template in the list, try hitting the Refresh button.

          Once you select the new template, try doing a preview to make sure the look of the notification is what you expect.
          thummel1
          Veteran Member
          Posts: 121
          Veteran Member
            Thank you for these instructions! I've been able to successfully convert the data from the info set to an email attachment.

            A couple formatting questions for you:
            1. Is it possible to remove the Info Set data from the body of the email but still include the info set data in the attachment
            2. Is it possible to change the HTML so that the data is transposed (so the column headers appear in Column 1 and the data for each header appears in column 2)

            These questions are for aesthetic reasons only, so if they cannot change that is total fine.

            Thanks!
            thummel1
            Veteran Member
            Posts: 121
            Veteran Member
              I have another question related to this that just came up. Is it possible to modify any of our existing html templates into an attached word document? I thought it might be as easy as adding the following code to the bottom of my existing HTML:
              [template=Audit Email Template&type=XLS]

              and changing the xls to doc:
              [template=Audit Email Template&type=doc]

              but that doesn't do the trick. Any suggestions on how to accomplish this?
              Dave Curtis
              Veteran Member
              Posts: 136
              Veteran Member
                1. Is it possible to remove the Info Set data from the body of the email but still include the info set data in the attachment

                Yes. In the email template, near the bottom, there is a reference to values variable. Should look like [values], if you remove that variable it will make the email NOT display the table.

                2. Is it possible to change the HTML so that the data is transposed (so the column headers appear in Column 1 and the data for each header appears in column 2)

                I try to not say something is not possible just because I have not done it so I will say that I have never done this and I, off the top of my head, do not see a setting that can be done to do this. I am sure if you were to get to the back end formating of the values section that you could create a custom values format that would do this.
                Withing the notification, under the related info section you can use Options for the table and alter the order of columns, sort things, etc. so I am sure there is code somewhere that you could create a template to allow this to be done.

                Dave Curtis
                Veteran Member
                Posts: 136
                Veteran Member
                  Is it possible to modify any of our existing html templates into an attached word document?

                  Yes, and you are correct, it is as easy as changing the XLS. I updated the template to [template=Audit Email Template&type=DOC] and it sent a WORD document.

                  If you created a new template and gave it a new name, make sure you update the template= section. So if you created a new template and called it Audit Email Template2, update that section to
                  [template=Audit Email Template2&type=DOC]

                  You can also make it HTML and the attachment will open in the users default HTML viewer (usually their internet browser of choice) and most browsers allow the user to right-click and export to Excel.