Can you simplify an xPath to improve performance? - InfoPath Dev
in

InfoPath Dev

Can you simplify an xPath to improve performance?

Last post 06-07-2012 05:47 AM by cpluce. 43 replies.
Page 1 of 3 (44 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 05-23-2012 05:33 AM

    Can you simplify an xPath to improve performance?

    I think its when the form query a list of tasks while switching views using this XPath the performance is slow 

    xdXDocument:GetDOM("Approval Task List")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:FieldName_83E80D35_F12A_42A7_BD3[../d:ID = xdXDocument:GetDOM("Library NAme")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Eg_x0020_Column_ID].

     Are what are some better ways to improve this? with or without code? OR can you imnprove this without code? what about converting this to client app form?

  • 05-23-2012 09:02 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    That formula looks about as simple as it can get.  What has led you to believe that this formula is causing the problem?  I would think that the query is the more likely culprit.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-23-2012 06:10 PM In reply to

    Re: Can you simplify an xPath to improve performance?

    when you say the culprit is the query, can you elaborate? I think you are right but I read on Microsoft site that you can improve performance by simplifying the xpath.  

     I have 4 views that query for data on each view. These query uses a data conection to a sharepoint list. The list that it receives data from has about 400 items and it has filter in the xpath without a field from another list that has 40 items.  Each view has about 20 of these fields with an xPath expression similar to the above. On each view the infopath form shows a message "sends data to the server for about 50 seconds"

    How can I improve this? Thanks 

  • 05-24-2012 10:38 PM In reply to

    Re: Can you simplify an xPath to improve performance?

    Is it the same query (set of data) for each view, just filtered differently in each one?  If so, are you rerunning the query (i.e. do you use an "Execute Query" rule) every time you switch views?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-25-2012 05:22 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    it's a different query for each view with different filters.  Each view has a picture button with 1 rule and 2 actions. First it queries the data connection (to SharePoint list with 400 + items) and than swicthes the view.

    Its like 4 phases with each phase has its own list of questions in the tasks(workflows), that displays each phases information on the form.

    I haven't tested all yet but I am thinking one of the following solutions:

    1. Swicth form to client app. form but not sure if this will speed up the query. BUt will elimnate postbacks

    2. use rest web service but not sure this will help because  I would still need to query the task list and current form's list for ID's to use in the URL filter.

    3. Write managed code which I can do but my last option if possible.

  • 05-25-2012 01:12 PM In reply to

    Re: Can you simplify an xPath to improve performance?

    Ok, so let me try to get us on the same page here.

    You've mentioned this list with 400+ items a few times.  Is each view referencing the same 400+ item list, with the use of filters, or does each view make use of a different 400+ item list?  If it's all the same list, are you re-querying it (i.e. re-triggering the data connection) every time you switch views?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-29-2012 05:15 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    Is each view referencing the same 400+ item list, with the use of filters?  COrrect I am using the same list but different filters on each view

    If it's all the same list, are you re-querying it (i.e. re-triggering the data connection) every time you switch views? Same list and yes to re-querying. I have tried this on form load to retrieve the data all at once but that just hindered the performance of the initial form load and was to slow.

  • 05-29-2012 06:18 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    Ok, well there's absolutely no reason to requery the list every time you switch views.  One query is all you need.  So how about adding a condition to the rule that performs the query to only do it if the data isn't loaded yet (the condition could be something like Number of occurrences of (repeating field) <= 1)

     Another alternative you might consider is actually filtering the data connection to only pull back the data you need for any given time.  Under this approach, you would query each time you switch views, but the query would be filtered so it shouldn't take too much time.  Two approaches to doing this are qRules' FilterOwssvr command and SharePoint 2010's OData REST services.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-29-2012 06:30 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    can you give me an ecxample of the first option?(the condition could be something like Number of occurrences of (repeating field) <= 1)

    I am trying to use Rest but I am having trouble with my filters

    I have a REST web service that queries a library when I push a button. However, it seems to only display the first item in the list and not using the drop down list value as my filter which I am trying to pass in the URL.

    I am keeping it simple. I have a form with:

    1 button with 3 rules
    1-updates REST connection with
    concat("http://webfrontend/site/_vti_bin/ListData.svc/Tracks?filter=Count eq", "'", field2, "'")
    2-Query REST Connection
    3-Set Field 4 's Value with the Column title fomr the REST secondary conection. (I think this is wrong?)

    1 repeating textbox(Field 4).
    1 drop down list (Field 2) which stores 4 values for filtering.  

    Have any links to articles regardimng these methods? When you say one query, where do I do this and how? I have tried one query on form load but was to slow duing load.

  • 05-29-2012 06:32 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    also, the data is never loaded more than once. Its different data for each view. Therefore, you need to query each time to get it.
  • 05-29-2012 08:21 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    This statement:

    also, the data is never loaded more than once.

    appears to contradict this statement:

    If it's all the same list, are you re-querying it (i.e. re-triggering the data connection) every time you switch views? Same list and yes to re-querying.

    How should I interpret this?  When you use the term "query" what do you mean specifically?  You seem to be using the word in an unconventional sense.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-29-2012 08:58 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    I have a single task list with more than 400 + items.

    Fro example:

    Column headings are: task 1, task 2, task 3 task 4, task 5, assigned to, task ID

    upon each view 1

    (Query connection) connects to list and retrieve title of task 1's value where task ID = to current/active forms' view 1ID.

    upon each view 2

    (Query connection) connects to list and retrieve title of task 2's value where task ID = to current/active forms'  view 2 ID.

    upon each view 3

    (Query connection) connects to list and retrieve title of task 3's value where task ID = to current/active forms' view 3 ID.

    etc. 

     Same list but differemt column values and ID's everytime.

    I have figured out how to display the XML/data using the REST URL and Owssvr but lack info on how to use a SharePoint list filed value in the URL.  

    I used a 9 page articel posted by your company called Filter a SharePoint List on the Server but got stuck on

    9. For the Field, select the command node in the secondary data connection called QdabraRules.  *I do not know what command node is?**

  • 05-30-2012 10:37 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    Hi - the tutorial you mention involves using our product, qRules - if you aren't using that, I'd imagine the tutorial would not be helpful.

    You can use OData, if you are using SharePoint 2010. REST is not the same as using owssvr.dll. You'll want to use REST connections to the OData service.

    Here's a video I put together on this: http://www.youtube.com/watch?v=B8P_SqO2q6g

     

    Hilary Stoupa

  • 05-31-2012 05:14 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    Thanks Hilary.  I actually had figured this out and came across this video and another one of yours. I am about tot test out the owssvr filter and see if this performs better.
  • 05-31-2012 10:40 AM In reply to

    Re: Can you simplify an xPath to improve performance?

    I am using the owssvr filter which works on my desktop but when I publish this as a web browser  I get

    An error occurred querying a data source.

    Click OK to resume filling out the form. You may want to check your form data for errors.

    Hide error details

    XML data that is required for this form to function correctly cannot be found.

    An entry has been added to the Windows event log of the server.

    Log ID:5566

    I am able to navigate to the schema with the same URL in the recieve connection  so not sure whats going on

Page 1 of 3 (44 items) 1 2 3 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.