Can I synchronize a filtered repeating nodelist with Submit & Refresh? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Can I synchronize a filtered repeating nodelist with Submit & Refresh?

Last post 12-20-2012 08:22 AM by Hilary Stoupa. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 09-27-2012 12:49 AM

    Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    Hallo,

    what i mean by this is this:
    I have repeating nodes in my InfoPath Scheme called "Topic" like this:
    my:form
       my:topics
          my:topic (repeating)
             my:topicType  (can be "information", "Decision" or "Task"
             my:SharePointTaskID
                 @my:qRulesLastModified

    If a Topic is of Type "Task", then it needs be submitted to a SharePoint-Tasklist and later on I would like to draw updates of that SharePoint-Tasks.

    Can I construct the "mapping.xml" in a way that I declare a filter that is to be used, when using qRules - Submit & Refresh functions?
    I would simply give the xpath to my repeating node a filter like this:

    /my:form/my:topics/my:topic[my:topicType = "Task"]

    The reason for all this would be a considerable improvement in schema and administration of it and later on documentation and training of users etc.

    But of course, what must not happen is, that qRules gets confused by all this and worst case, deletes nodes :-) I would need a definitive answer on this, please book it, if you need to reasearch!

    thanks!

  • 09-27-2012 03:08 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

     Hi-

    Yes, it is possible to filter when using the SubmitToSharePointList command, though sometimes working out the correct xpath expression can be tricky, as discussed in this forum post.

    Good luck!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-27-2012 05:35 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    Thanks Ernesto, great. My mistake, it is actually also in the manual under "Additional Obeservations" at RefreshSharePointListItems in the last sentence and you give a good example. I oversaw that.

    Now, that I come to think of it, I realize that the Refresh-Function WOULD actually not only update my InfoPath-nodes, but also delete them, if the corresponding items in SharePoint are deleted. I understand that this is a feature, that is needed in other solutions.

    However, what if in my case I only want updates? And if the SharePoint-Item doesn't exist any more, then qRules does nothing with my InfoPath-node. 
    Can I somewhat configure to what extent these Refreshes change my InfoPath-Form? So in effect I am thinking of one more parameter or annother value for the existing mode-parameter.

    Thanks

  • 09-27-2012 02:03 PM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    The key lies in the ID field. qRules compares the ID field in the form to the ID field in SharePoint. If the item is missing from the SharePoint list, then the item with that missing ID is removed from the form.

    You could:

    1. Query the list to get back just/only the IDs.

    2. If an item in the form has an ID that is not in the list, use SetValue to clear that ID field.

    As soon as you clear the ID field in your main data source, qRules won't try to perform any update/delete. qRules will treat that item as a new item (since it has no ID).

    3. Then run Refresh. 

    qRules doesn't know that the item was suppossed to be in the list, and won't delete it. But it will add it back to the SharePoint list as a new list item.

    Does that help?

     

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 10-16-2012 11:41 PM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    thanks for the input. I got this working exactly as you suggested.

    I am not sure whether to open a new thread but it kind of fits this topic: I have the issue that a qRule-Submit always writes all InfoPath-nodes to the Task-List, instead of just the ones that changed. When I look at the (versioned) task items in SharePoint I see, that InfoPath/qRules always updates the Description(Richtext) Field, although I did not (knowingly) change the field in InfoPath.

    In the end the SharePoint item itself holds correct data, however the update will take valuable performance time when updating all 50 tasks in a form and not just a couple of them. And it will produce alert-messages, that we configure on the list. So I would like to correct this behaviour.

    Can you point me to the direction how to further debug this?

    thank you

  • 10-17-2012 07:56 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    qRules is not tracking whether items in your form have changes - thus if the submit command is set to run it will update all of them.

    You could track this, though, and modify the filtered xpath to your repeating group appropriately.

    That is, you could have a field in your repeating group called "changed" and if something changes in the form and you want to update the item, you could set changed to true. Prior to running the submit command, you could modify the xpath in the mapping's repeating group node so that the filter is [changed = 'true']. Then only the changed items would be updated.

    Hilary Stoupa

  • 10-23-2012 05:27 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    thanks Hilary.

    Well, I understand this workaround. But there must be something going on with synching RichText. When I look at the version list for an item, Richtext is always submitted, whereas other Fields such as  Title or  Due Date, they are only updated when they are actually changed.

    So I would conclude, that SharePoint sees all fields, since qRules provides all of them, but SharePoint sees the submitted RichText-String differently to what is already stored, so it interprets it as changed. I kind of did some heavy duty testing and sychronized the task between Outlook, SharePoint, InfoPath and SP Workspace. When I look at the tasklist via Owssvr to see what the value actually says, I observe that the dialect of the xml/html somewhat changes. Sometimes it even breaks and becomes uninterpretable by InfoPath. I will deal with these errors later, if and when they actually occur in normal environment.

    For now, I will install the method you describe - thank you

  • 12-20-2012 04:27 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    Hallo Hilary,

    I get an error, when I try to this workaround.

    Before I call the submit rule I set the RepeatingGroup-node to the filtererd xPath: my:ResultProtocol/my:Topics/my:Topic[my:Type="Task"]/my:Tasks/my:Task[@my:Submit="true"]

    On Submit, qRules throws an error: Failed to select node for SharePoint List Id: my:SPTaskID

    The Syntax should be fine, Have you got an idea?

    Thanks

    Michael

  • 12-20-2012 05:47 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    I stumbled over my Topic-Filter and deleted it, so I would only have one xpath-Filter on the Task-Node, so the error does not occur any more, but:

    When I open an existing form, it refreshes its local task information with latest SharePoint Task Information. When I hit submit, then all these SharePoint-Tasks, that the form refers to get deleted.

    Now, when I think about it, isn't this expected behavior? I am kind of confused now. on the one hand it should delete SharePoint-Tasks and then again it should not. This submit-Field (you called it "changed" in you post) is "false" after refresh. How can I determine when to delete? Somehow qRules stores the information on refresh so it knows, which Tasks/nodes got deleted during the session and it deletes those that I excluded in my xpath in SharePoint on the next submit. The manual describes this. Can I influence this behavior?

    So now I am back at the beginning :-)

    Michael

  • 12-20-2012 07:11 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    I may be a little confused too - when we refresh, we compile a list of all the items that are in the XML that have a SharePoint ID - so we know which ones are removed from the XML while the form is in use, and can delete on submit.

    But, looking back at your original post, I believe you and Jimmy have had some email exchanges on some other issues with rich text that might lead us to the root of your initial issue - which was that on submit all items with rich text are being updated in the list - they are considered changed. I think what I'd like to do is run a few tests, see if any of the recent changes we've made address that, and if not, address the root issue instead of look for work arounds. Does that sound good to you?

    Hilary Stoupa

  • 12-20-2012 07:25 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

     yes that sounds good. Thank you.

  • 12-20-2012 08:22 AM In reply to

    Re: Can I synchronize a filtered repeating nodelist with Submit & Refresh?

    joanfuture:
    Well, I understand this workaround. But there must be something going on with synching RichText. When I look at the version list for an item, Richtext is always submitted, whereas other Fields such as Title or Due Date, they are only updated when they are actually changed.

    So - I have a form mapped to a list - the list has a rich text field, but I don't have it mapped currently. When I submit from my form to the list, my item (which is currently only submitting to a simple text field) always shows an updated modified date & a new version in the version list, even though I am not submitting / updating to the rich text field. Was your approach different? That is, were you comparing with a list that has no rich text fields? I'm just wondering why I am getting a different result.

    Hilary Stoupa

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