Cannot save query data from 2nd connection in xml file. - InfoPath Dev
in

InfoPath Dev

Cannot save query data from 2nd connection in xml file.

Last post 01-27-2017 01:29 PM by blkmagik. 30 replies.
Page 1 of 3 (31 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 09-21-2016 11:45 AM

    Cannot save query data from 2nd connection in xml file.

    Hello I created a form that querys data from a sharepoint list connection. When I save the form in the library and reopen it, it doesn't show the data that displayed prior to the same. Is this possible or am i doing something wrong?Thanks
  • 09-21-2016 04:50 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

     This was very confusing for me when I first started using InfoPath too! But InfoPath is only going to save data that is entered into fields in the main data source. So if you have fields on your form bound to a secondary data source, and the user changes those values - it won't save back to that data source. Does that make sense? Maybe you could describe what you are trying to accomplish and I could give you some ideas?

    Hilary Stoupa

  • 09-22-2016 01:28 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    Hi there Hilary

    Nice to meet you and thank you for your time. Ok what i'm attempting to do or what i've done so far is create a info path form which i published to a share point library. The purpose of the form is to query data from a share point list which would hold listed account items for potential write off. The field requirements are as follows


    • COBA (Company Code/Business Unit)
    • Write Off Type
    • Company
    • Customer
    • Invoice Number
    • Invoice Date
    • Amount
    • Comments

    Analyst should be able to use a predefined drop down list to query the data based on the COBA which is then populated on a repeating table for comment input and submit the changes to the Sharepoint list. Once complete the form is then saved in a document library, which Sr Managers will be able to open review and mark for approval.

    For this portion the Sr Manager can click an approve button after entering their password which will populate a Picture Box for an image of their signature, their name, job title in separate text boxes. The information is for their signature, name and job title is queried using their password from another share point list (secondary connection)

    As you mentioned in you response the repeating table for the Write off portion cannot be saved since its a secondary connection and the repeating table is not part of the Main form. The work around i managed was to separate the write off process as a form of its own

    The problem i'm now having is to find a way to carry the write off data into the Approval form for the managers to be able to read and review. Obviously i can query the data using the secondary connection but cannot save the data since the fields are not part of the main form and cannot store the data.

    Ive looked around for alternatives some involved coding which i tried to adopt to my form but had too many errors since i'm new to all of this. I also tried to look for an alternative to copy one repeating table to another but cant seem to under stand how its done and this seems the best direction to go for. Would very much appreciate you help and guidance on this.

     

     

    Thanks. ps i can forward you the form i created but would prefer to send it to you direct.

  • 09-23-2016 07:20 AM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    The options for copying data from one repeating table to another are code, qRules (a code add in that the company I work for produces), or, if you have a general idea of how many rows your max will be, default data can also do the trick. I am attaching a sample form that uses the default data (no code) approach - save it locally, right click and select design, then you can preview, take a look at the rules (check the defaults under the data tab in the ribbon), etc.
    Hilary Stoupa

  • 09-23-2016 09:32 AM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

     Thanks Hilary,

    This looks promising, I seem to understand the concept. However im not quite clear how you managed to set up the rules for the button and the copy attribute field.

    For the button I see a value of 1 but I don't know how this was created or what it is referring to

    For the copy attribute field. i'm also unclear how to replicate the formula: Node[count(current()/../preceding-sibling::group2) + 1]/Title. 

    I do understand that Node is referring to the secondary repeating table field and that the rest of the syntax  looks to be part of filtered data? I don't seem to know how this part was done.

     

    Thanks! 

     

     

     

  • 09-23-2016 10:19 AM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

     The button sets a field in the repeating group to 1. Since the button is outside the repeating group, it sets all instances. That causes the rules the on the field to fire. The index in the square brackets is created by counting the preceding siblings of the current group2 node, it was written by hand. You can click the edit XPath checkbox to see the full syntax. Valid syntax will depend on correct XPath for your schemas.

    Hilary Stoupa

  • 09-23-2016 02:43 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

     

     Hilary

     I managed to get the button to work. It copies the data to the repeating table destination  however it duplicates and concatenates all the data for each of the rows I have set.  I played around with it  and understand that I has to do with the syntax I am using in for the xpath formula.

    So far this is what I came up with

    xdXDocument:GetDOM("WriteOffQueryData")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[count(current()/../preceding-sibling::group4) + 1]/COMPANY

     but I keep getting a "../preceding-sibling::group4" does not point to a valid location path of a field or group. error message. Im unsure what im doing wrong. the destination repeating table xpath is /my:myFields/my:group3/my:group4

    again not sure what im missing regarding the syntax 

     

     


     

     

     

     

     

     

     

     

  • 09-23-2016 02:47 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    This is on a field in group4? Be sure you add the my namespace in your formula - current()/../preceding-sibling::my:group4
    Hilary Stoupa

  • 09-23-2016 02:55 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

     Yes COMPANY is a field in group4. I made the recommended change but now im getting an error of  "xdXDocument:GetDOM("WriteOffQueryData")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/COMPANY" does not point to a valid location path of a field or group

  • 09-23-2016 03:00 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    Is COMPANY also a field in your SharePoint List items? What's the namespace prefix on it? Can you right click the field in the task pane and copy the XPath?
    Hilary Stoupa

  • 09-23-2016 03:06 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    Yes Company exist in the sharepoint list items Hes is the list of fields in the sharepoint list COBA COMPANY (xpath /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:COMPANY) CUST INVNO INVDATE AMT COMMENT WOTYPE ID here is the list of fields for group4 COPY (attribute field) COMPANY (xpath /my:myFields/my:group3/my:group4/my:COMPANY) CUST INVNO INVDATE AMT COMMENT at the moment im only testing with the COMPANY field to ensure i get a clearer picture.
  • 09-23-2016 03:09 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    xdXDocument:GetDOM("WriteOffQueryData")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[count(current()/../preceding-sibling::my:group4) + 1]/d:COMPANY
    Hilary Stoupa

  • 09-23-2016 03:15 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    That Works!!!!! thanks you are awesome.. i cant believe that d before company was the cause of my problems. Again appreciate your time, patience and expertise.
  • 09-23-2016 03:30 PM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    Those namespace prefixes get tricky, because InfoPath doesn't show them to you in the formula editor, so when you start working on stuff by hand, it is easy to forget them. :)
    Hilary Stoupa

  • 01-26-2017 09:55 AM In reply to

    Re: Cannot save query data from 2nd connection in xml file.

    Hi Hilary I would like to request your assistance on a little issue i'm having with my form. Since the last time i contacted you there was a recomended need to add summary subtotals to the original form. I originally used a Dropdown list box with a secondary field to calculate the total amounts for each customer name identifed from the source data. Unfortunately it was suggested for me to do a fixed table. I did so using a repeating table and used an expression to isolate and display the customer names as unique entries (no duplicates) by using the expression COMPANY[not(. = preceding::COMPANY)] However when i attempted to get the total amount it only displayed the correlating amount associated with the customer name on the that particular row, rather than giving me the total amount for each identified customer Is there a better way for me to get the subtotals that i need. Would an expression be a better route? If so what is the correct syntax for it?
Page 1 of 3 (31 items) 1 2 3 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.