Copy table command copy only items after filtering first a sharepoint list. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Copy table command copy only items after filtering first a sharepoint list.

Last post 10-13-2015 02:38 PM by Rommel Sta. Juana. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 08-24-2015 10:37 PM

    Copy table command copy only items after filtering first a sharepoint list.

    Hi,

    Good day. We are currently using  Qrules 7.1 and trying to use the copy table command. Below is the step that I'm trying to execute.

    1. I have a data connection to a SharePoint List and displaying it in InfoPath.

    2. Then I would pass a parameter to filter the SharePoint List.

    3. I would execute the copy functionality.

     From here, what I would like to achieve is to copy only the items after I had filter the SharePoint List. I had attached a screenshot and on the 2nd image, the copy table function is copying the same ID ( 17548).

     Maybe something wrong with my rules. Thank you in advance.

     

    Regards,

    Rommel 

  • 08-25-2015 07:38 AM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    What is the syntax of the command you are using?
    Hilary Stoupa

  • 08-25-2015 02:33 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Hi Hilary,

     Good day. On the copy button I have two rule as below.

    1. Delete /xpath=/my:myFields/my:Filtered/my:WIP

    2. concat("Insert /parent=/my:myFields/my:Filtered /child=my:WIP /count=", Count)

    where "Count" is the number of row on the filtered list

     

    Then on the repeating table, I have the below rules

    1. SharePointListItem_RW[number(Count)]/ID   or xdXDocument:GetDOM("WIP Workbench")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[number(xdXDocument:GetDOM("ViewOptions")/Util/fields/Count)]/d:ID  when I edit xpath

    2. Title[ID = current()/ItemId] or xdXDocument:GetDOM("WIP Workbench")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[../d:ID = current()/my:ItemId] when I edit xpath.

     

     Also, can the copy table work when the connection to the sharepoint list is a REST Web service. This is for the reason that I need to filter a sharepoint column (number) using the greater than operation.

     

    Regards,

    Rommel 

  • 08-25-2015 03:02 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

     Oh, okay, so you aren't using the CopyTable command, but you are using Insert and then setting a field's value. You can use this method with a different style of web service connection - REST is fine too. But it seems that maybe "count" isn't the value you anticipate when your rule 1 above runs, since you are getting all items set to the same value.

    Are you decrementing the counter somewhere? If not, it will always be "3" or whatever, and always return the same item. I tend to use preceding sibling - like:
     xdXDocument:GetDOM("WIP Workbench")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[count(current()/preceding-sibling::my:YourRepeatingGroupNameHere) + 1]/d:ID 

    Hilary Stoupa

  • 08-25-2015 05:16 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Hi Hilary,

     Thank you very much for this. It works for a data connection to a SharePoint List. I will have a try using the same approach using REST connection to a SharePoint List

     

    Also, can I inquire if you have some documentation or video for the actual copy table command? I cannot seem to find it on the site or anywhere else. Thank you for all the help..

     

    Regards,

    Rommel 

  • 08-25-2015 06:16 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Have you looked at the command overview that installs w/ qRules? I don't know if we have anything specific - but it should be covered there. qRules also installs with a sample form: C:\Program Files (x86)\Qdabra Software\Qdabra Rules Library\Forms\Installable Forms or C:\Program Files\Qdabra Software\Qdabra Rules Library\Forms\Installable Forms is the default location.
    Hilary Stoupa

  • 09-06-2015 03:21 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Hi Hilary,

    Good day, its me again. I had try to check the location for the installed form and I was able to see one for the copy table but it is for copying tables for the same data source.

    From my previous example, I was able to make the Insert and setting of a fields value work from a data connection from a SharePoint List.

    I'm doing the same approach but this time a REST connection to a SharePoint list but it is only copying the first item on the filtered REST connection

    Below are the syntax use:

     

    For the copy button:

    1. Delete /xpath=/my:myFields/my:Approval/my:ApprovalItems

    2. concat("Insert /parent=/my:myFields/my:Approval /child=my:ApprovalItems /count=", TotalItemsForApproval)

    where TotalItemsForApproval is the number of items in the filtered REST Connection

     

    On the repeating table:

    1. properties[count(current()/preceding-sibling::ApprovalItems) + 1]/Id or   xdXDocument:GetDOM("Rest1")/ns2:feed/ns2:entry/ns2:content/m:properties[count(current()/preceding-sibling::my:ApprovalItems) + 1]/ns1:Id

    2. ProjectNumber[Id = current()/ID] or  xdXDocument:GetDOM("Rest1")/ns2:feed/ns2:entry/ns2:content/m:properties/ns1:ProjectNumber[../ns1:Id = current()/my:ID]

     

    Regards,

    Rommel 

  • 09-07-2015 12:22 AM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Hi Rommel,

    Here's a sample form with Copy Repeating Data logic from a secondary data source: 

    http://www.infopathdev.com/blogs/patrick/attachment/70001.ashx

    Kindly download and open the form in design mode.

    Your copy repeating data logic might be different from this appraoch, but you may use this sample form as reference for any logic you may have missed.

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 10-12-2015 09:24 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

     Hi Hilary,

     Good day. I was using the Insert and setting value on a REST Web service connection to a SharePoint List. I do have another question, is there any chance to limit the data return by the filtered REST connection for example to the first 100 item and have a paging functionality to retrieve the next 100 and so on when a user clicks a button or similar functionality.

     

    Regards,

    Rommel

  • 10-12-2015 09:41 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Hi,

    To set a limit for the number of rows returned, you could use the query option $top=100, where 100 is the number of items returned. The tricky part here is to have an identifier in the list which you will be using as basis for the paging. So if you are going to use the list's ID, you would have to set the paging button to query the next 100 rows where ID is greater than the last ID number of the previous query. I hope this makes sense.

     

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 10-12-2015 09:54 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

     Hi Don,

     Good day. Thanks for the advice, that is I think what I need. Will putting a textbox on the repeating table and using the preceding-sibling formula work to have a row number?

     

    Thank you once again.. 

  • 10-12-2015 10:08 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    To have a row number, yes that would work, but as an identifer to get the next page or the next batch of query? it must be server sided.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 10-12-2015 10:22 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Hi Don,

    Having said that, is it correct that I need to number all the entries on the list? If I do that, can you please advise on how I can progress to go to the next page of the result? Thanks.. 

  • 10-13-2015 01:31 AM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

    Yes, this is the mind boggling part. I think we can use the default list ID for the numbering (instead of adding the numbers for all entries). To get the next page is simple, all you need to do is add a filter to your query string where ID is greater than the last row's ID (higest ID value). For the Back button, I would suggest keeping a hidden field which will hold the last page's lowest ID value. If the user will click the back button, set the query string to include a filter where ID is equal to or greater than the previous page's lowest ID. Does this make any sense?

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 10-13-2015 02:38 PM In reply to

    Re: Copy table command copy only items after filtering first a sharepoint list.

     Hi Don,

    Good day. Thank you again for the guidance on this. Yes it does make sense, I will have a try to add multiple filter on the REST Data connection like top 50 and ID is greater than the last ID on the first page. I will get back to you if I run to some issues. Thanks..

     

    Regards,

    Rommel 

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