Question for CopyTable command with seconday data source - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Question for CopyTable command with seconday data source

Last post 05-10-2016 10:31 AM by poemstar. 22 replies.
Page 1 of 2 (23 items) 1 2 Next >
Sort Posts: Previous Next
  • 04-08-2010 01:49 AM

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Question for CopyTable command with seconday data source

    Hi, related to this entry I have similar the same problem, but without the error message.

    I use qRules 2.1 and try to use the command CopyTable to transfer a filtered table (from a secondary data source) to another repeating table of the form.

    I have this structure:

    MoM
       Groups
            grpDecisions
                 decid
                 DecTitle
                 DecDescription
                 DecDate

    Then I have a secondary data source (XML format, used by FilterOwssvr command), this source is connected to a Sharepoint decision list with the same attributes.
    The structure of the data source (the name is XMLDecisions) is, the node s:Schema is excluded:

    xml
       rs:data
           z:row
               :ows_LinkTitle
               :ows_Decision_x0020_Date
               :ows_Description

    Now I tried to use CopyTable command with following syntax:

    CopyTable /dsnamesrc=DecisionsXML /tablesrc=/xml/rs:data /rowsrc=/z:row /tabledest=/my:MoM/my:Group /rowdest=/my:grpDecisions /empty=yes

    But if I executed the command I got no data in the other table.
    Regarding to this post about the secondary data source I tried then this syntax:

    CopyTable /dsnamesrc=DecisionsXML /tablesrc=/dfs:xml/dfs:data /rowsrc=/dfs:row /tabledest=/my:MoM/my:Group /rowdest=/my:grpDecisions /empty=yes

    And got also no data in the other table. :-(

    Maybe someone can help me with this issue or have an explanation how I can use the CopyTable command with secondary data sources?

    Many thanks
    Tobias

    PS: I'm sorry if the english is not so perfect, my native language is German.

  • 04-08-2010 06:10 AM In reply to

    Re: Question for CopyTable command with seconday data source

    Hi Tobias,

    I'm sorry you're having issues. Your English is easy to understand, so don't worry about that.

    The first thing I notice is that your source and destination don't match: one has 3 fields and the other has 4. This may be causing CopyTable to fail.

    The qRules secondary data source contains an error node. Would it be possible to display this in the view (temporarily) in order to debug? When you execute the command, does this node have an error message? This will help us narrow down the issue.

    Thank you.

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


  • 04-08-2010 07:09 AM In reply to

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Re: Question for CopyTable command with seconday data source

    Hi Ernesto,

    thanks for your reply.

    Yes, the destination table has one more field, I use the ID as optional field for the command SubmitToSharePointList.
    I added this ID-field now to the XML data source with a specific view, the structure of the data source is now:

    xml
       rs:data
           z:row
               :ows_LinkTitle
               :ows_ID
               :ows_Decision_x0020_Date
               :ows_Description

    For instance, the full XPath of the LinkTitle shows /xml/rs:data/z:row/@ows_LinkTitle.

    And of course, I added the error field to my view and got this message:
    "An error has occurred executing the rule. Failed to select the source table to copy from."

    And I must correct a little error in my description above, the name of the XML data source is DecisionsXML, not XMLDecisions.

    Regards
    Tobias

  • 04-08-2010 07:37 AM In reply to

    Re: Question for CopyTable command with seconday data source

    Hi Tobias, thank you for the additional information.

    So the error tells us that the command is failing to select the source now. Let's look at the parameters one by one:

    This one is probably OK:
    /dsnamesrc=DecisionsXML

    For:
    /tablesrc= and /rowsrc=
    In InfoPath, go to the data source taskpane and right click on these nodes in the secondary data source. Select copy xpath.

    Another option is to preview your form, save the XML, and then look at the xml in a text editor so you can get the xpath. The real tricky thing is to get the namespaces correctly.

    One more observation: In your data sources, can you reorganize the nodes, like this? (so that the order matches)

    MoM
       Groups
            grpDecisions
                 decid
                 DecTitle
                 DecDescription
                 DecDate

    xml
       rs:data
           z:row
               :ows_ID
               :ows_LinkTitle
               :ows_Decision_x0020_Date
               :ows_Description

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


  • 04-08-2010 08:08 AM In reply to

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Re: Question for CopyTable command with seconday data source

     Hi Ernesto,

    I did it and copied the data and row node, here are the XPaths:

    For tablesrc: /xml/rs:data
    For rowsrc: /xml/rs:data/z:row

    If I save the form as XML and look into the file I saw no values in the repeating table section (grpDecisions), only the attribute fields. But in the preview mode I see the values of the data source table, 6 rows. 

    A reording is not possible for the XML data source, the options to move fields are not active. The fields in the Sharepoint view have the correct order.
    But I tried to order the fields of the main source into the same order of the XML data source, without an effect.

    Regards
    Tobias

  • 04-08-2010 11:27 AM In reply to

    Re: Question for CopyTable command with seconday data source

    Hi Tobias,

    Would it be possible to obtain your XSN to take a closer look?

    You can either attach it to this post (via the Options tab) or email it to support at qdabra dot com.

    Thanks!

     

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


  • 04-09-2010 12:33 AM In reply to

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Re: Question for CopyTable command with seconday data source

    Hi Ernesto,

    I recreated the form only with the listed structure and attributes. I will send you the template to the support address.

    You cannot access the internal XML data source if you open the form, so you must recreate the data source and the Sharepoint list in your environment.

    A short information to my system, I use InfoPath 2007 SP2 with Windows 7.

    Regards and thanks for the help,
    Tobias

  • 04-09-2010 06:29 AM In reply to

    Re: Question for CopyTable command with seconday data source

    Hi Tobias,

    I believe the problem is that you are trying to copy attributes (in the secondary data source) into fields (in the main data source).

    I used some sample data I have in SharePoint, and discovered that I can copy from attributes to attributes succesfully. This is the command I used in my form:

    CopyTable /dsnamesrc=owssvr /tablesrc=/xml/rs:data /rowsrc=z:row /tabledest=/my:myFields/my:group /rowdest=my:repeatingfield

    Could you verify if copying attributes to attributes will work for you?Thanks.


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


  • 04-12-2010 12:41 AM In reply to

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Re: Question for CopyTable command with seconday data source

    Hi Ernesto,

    you are right, I try to copy some list entries from the Sharepoint list into a repeating table.

    I changed the data source name and the fields to your example but now I get the error "An error has occurred executing the rule. The table row of the source and destination must contain the same number of elements and attributes." I have the same attributes in both tables, I changed also the order but the attribute names are different. I can't change the attribute names of the data source.

    Regards
    Tobias

  • 04-12-2010 07:45 AM In reply to

    Re: Question for CopyTable command with seconday data source

    Hi Tobias,

    The error message indicates that the source and destination have a different number of fields or attributes (and not a problem with the attribute names). Can you send me your latest XSN, or attach a screenshot of your source and destination?

    Thanks.

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


  • 04-13-2010 12:36 AM In reply to

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Re: Question for CopyTable command with seconday data source

    Hi Ernesto,

    yes, I attached the screenshot of the main and secondary data source to this reply. I hope these pictures are enough?

    Regards
    Tobias



  • 04-13-2010 04:55 AM In reply to

    Re: Question for CopyTable command with seconday data source

    Hi Tobias,

    The command is failing because your secondary data source has attributes, yet the main data source has elements. You'll need to change your main data source to have a repeating field with the four necessary attributes.

    Also, when you re-design your main data source, make sure that the order of the attributes matches the secondary data source order: Title, ID, Description, Date.

    Hope this helps.

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


  • 04-13-2010 05:53 AM In reply to

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Re: Question for CopyTable command with seconday data source

    Hi  Ernesto,

    I sent you an updated template to the support address, included is the XML source file (static).
    I changed the fields to attributes, also the ordering and got still the error message.

    Maybe you can modify the necessary settings so that I can see and compare what my wrong steps are.

    Thanks a lot
    Tobias

  • 04-13-2010 06:11 AM In reply to

    Re: Question for CopyTable command with seconday data source

    Hi Tobias,

    Your main data source still contains a repeating group instead of a repeating field, so there is still a mismatch with the secondary data source.

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


  • 04-13-2010 07:48 AM In reply to

    • tobiasa
    • Not Ranked
      Male
    • Joined on 04-08-2010
    • Vienna, Austria
    • Posts 11

    Re: Question for CopyTable command with seconday data source

     Hi Ernesto,

    I understand, so I have to change the group to a repeating field and add the attributes to the field. I changed the structure now (screenshot is attached) and got the same error. So the structure is still wrong?



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