Very slow CopyTable - InfoPath Dev
in

InfoPath Dev

Very slow CopyTable

Last post 01-25-2012 09:56 AM by Hilary Stoupa. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 01-18-2012 10:42 AM

    Very slow CopyTable

    I don't kow if anyone uses CopyTable to pull over as many items as I am in this form I'm working on, but it is copying over very slow.  Any suggestions on how to speed it up, or am I just going to have to deal with it.  I usually copy over batches of 200+ items.  My rules that run on button click are -

    SetQuery - set the items to copy over

    Query - query the list

    Copy Table - based on query

    Delete Blank - Delete items from table that have an item value of ''

    SetField1 -

    SetField2

    SetField3

    Sort Table

    Clear Errors

     

    This is taking over 2 minutes each time. 

    Suggestions?

  • 01-18-2012 12:16 PM In reply to

    Would exporting this list to an XML file, and then copying data from the XML be faster?

  • 01-19-2012 07:35 AM In reply to

    To start with, I would try to figure out if one particular rule action is slow. So, disable everything after the Query - how's the time?

    Then, add the Copy Table rule back - still slow?

    What makes sense to me is first figuring out if it is copy table that is slow, or if it is the query. When you copy the table, is the data displayed on the form view? If the form is rendering a repeating table with 200+ items, it is not going to be the copying that is slow, but the actual rendering of the form that is slow.

    Hilary Stoupa

  • 01-19-2012 07:58 AM In reply to

    I had done what you suggested last night.  I broke the list up into multiple lists (by category; that's what the set query field was setting), just to rule that part out.  So now the rule just queries the list (which I need to do since I don't query on form load).

    All the set value rules after the copy have been disabled for now.

    This seems to have sped it up a bit, but I haven't broke down any of the really big categories yet.  I will update when I do.

    Is it possible that setting query fields slow things down? 

    Also, the list requires a basic query before it can be copied over, right?

    Any way to speed up the table rendering, or is that just a limitation of InfoPath?

  • 01-19-2012 08:16 AM In reply to

    Here's what I did recently for a form I was working on that required copying a great deal of data into the main data source. This data had a heirarchy - Category, Subcategory, Question.

    So, first I downloaded and copied in the categories, displaying those on the view with + and - buttons to expand and collapse the levels. The first time the user clicks the plus by the Category, it downloads and copies in the Subcategories for that Category only. The first time the user clicks the plus by the Subcategory, I download and copy in the Questions for that Subcategory only.

    This greatly improves the feel of the performance in the form.

    Simply setting query fields should not slow things down - unless you are executing a query every time you set them. What I look for is whether the fields I am setting have additional logic on them that could slow performance.

    Here's a link on improving performance in forms. It says for IP 2007, but it is applicable to other versions. Search for Slow HTML Performance on that page for some additional information and possible troubleshooting tips.

    Hilary Stoupa

  • 01-19-2012 10:26 AM In reply to

    Here's another thing I'm curious about -

    The table I am copying over is pretty much static . . . it VERY rarely gets changed.

    Is there a way to include a static table inside an infopath form so it doesn't have to copy over every time?

  • 01-19-2012 01:06 PM In reply to

    Hilary Stoupa:

    Here's what I did recently for a form I was working on that required copying a great deal of data into the main data source. This data had a heirarchy - Category, Subcategory, Question.

    So, first I downloaded and copied in the categories, displaying those on the view with + and - buttons to expand and collapse the levels. The first time the user clicks the plus by the Category, it downloads and copies in the Subcategories for that Category only. The first time the user clicks the plus by the Subcategory, I download and copy in the Questions for that Subcategory only.

    This greatly improves the feel of the performance in the form.

     

    Yeah, I've sort of done that already.  Unfortunately, the smallest section I can widdle it down to in my scenario is "Category", and each category has 80 - 250 items.  Also, as I pull in more categories into my table, the longer it takes.  Even with the smaller queries. 

    I'll check that link, and see if there's anything in there that can help.

     

  • 01-19-2012 01:55 PM In reply to

    Is it possible to do a paging type of filter on my table?  So that user could click next or previous and show 50 or so items at a time?  Do you think that would help? 

  • 01-19-2012 02:21 PM In reply to

    I'd test that - download a category with fewer items (if you don't have one, perhaps you can create one? Or limit the number of rows some other way?)

    That is, simulate the scenario. Is the performance what you need? If so, then move forward with the approach. Again, if the issue is with rendering, having fewer rows on the form will speed things up. You could leave your current rows in place, not display the table (for testing purposes) and set a field's value when your rules are finished to allow you to see if the logic is slow or the rendering is slow. Then you would know what the speed bump is and can work from that point.

    Hilary Stoupa

  • 01-19-2012 05:14 PM In reply to

    Hilary Stoupa:

    I'd test that - download a category with fewer items (if you don't have one, perhaps you can create one? Or limit the number of rows some other way?)

    That is, simulate the scenario. Is the performance what you need?

    Yes, a smaller category in my table (15 items) performs normally.

     Again, if the issue is with rendering, having fewer rows on the form will speed things up.

    Fewer rows DISPLAYED, or just fewer rows existing in the form? 

    You could leave your current rows in place, not display the table (for testing purposes) and set a field's value when your rules are finished to allow you to see if the logic is slow or the rendering is slow.

     So if I add a Set Checkbox rule after the CopyTable rule, the box will only be checked after the data is copied over?

    Is testing the form in the client (preview) an accurate gauge of how the form will render in the browser?  Or should I publish the form and test again after every change?

  • 01-20-2012 08:14 AM In reply to

    Rendering is the display, so yes, not showing the data on the form can help you understand if the issue is with rendering.

    I don't know what a "set checkbox" rule is. I'm assuming you mean if you add a rule to set the value of a True / False field to true after your other rules have run - if so, then the answer is yes. Rules run in order. So you could add a rule to the end of the ruleset to let you know when the ruleset is complete.

    I think I must not be explaining myself well, here. What I'm suggesting is that, for the purposes of trying to troubleshoot your form performance issue, you remove any control on your form view that is bound to the data source you are copying into. Add a way to let yourself know when the rules you are running are complete - like setting the value of a field that is displayed on your form. Then see how the form behaves.

    I have found enough challenges with browser forms that I generallly also like to test in the browser.

    Hilary Stoupa

  • 01-23-2012 12:20 PM In reply to

    So here's what I did . . . I re-created this section of my form in a new, test form.  This problem table in my original form is on a different view of a much larger, multi-view form.  When I recreate this table in a test form, with the copy and set values and the formatting and everything, it works great.  No lag over 10 seconds.  However, I didn't resize the table, or change the look of it at all (column widths, header titles, etc)

    There are also 2 other sections displayed on the same view as the problem table with my original form.  However, those sections are static, and the data doesn't change. 

    Do you think that since the problem table is inluded in a much larger form, that could be causing the issue?  Does bordering, row size, shading, etc affect the rendering process? 

    In the meantime, I think I will just move the table and buttons over to a seperate view on my original form and see if that changes performance at all. 

  • 01-25-2012 06:08 AM In reply to

    It appears the copy table is lagging.  It takes over 2 minutes, even when I am hiding the entire table. 

    Since the form is so large, does the order of the groups and nodes in the schema make a difference?  The repeating table in question is about 10 groups down the list in my data tree.  That's the biggest difference I see between the form that doesn't work, and the test one I recreated with only the repeating table and rules. 

    I've tried everything I can think of to speed my trouble form up, but it is still lagging. 

  • 01-25-2012 09:56 AM In reply to

    Can you email me your form? I'd like to take a look at it - include some info on where the rule is, so I don't have to hunt for it. :)

    Hilary Stoupa

Page 1 of 1 (14 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.