Question for CopyTable command with seconday data source - InfoPath Dev Sign in | Join | Help in Qdabra qRules Qdabra Software Product Support (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » Qdabra Software Product Support » Qdabra qRules » Question for CopyTable command with seconday data source 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: Oldest to newest Newest to oldest Previous Next 04-08-2010 01:49 AM tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Question for CopyTable command with seconday data source Reply Contact 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 DecDateThen 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_DescriptionNow 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=yesBut 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=yesAnd 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 thanksTobiasPS: I'm sorry if the english is not so perfect, my native language is German. 04-08-2010 06:10 AM In reply to ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 04-08-2010 07:09 AM In reply to tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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_DescriptionFor 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.RegardsTobias 04-08-2010 07:37 AM In reply to ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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=DecisionsXMLFor:/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 DecDatexml rs:data z:row :ows_ID :ows_LinkTitle :ows_Decision_x0020_Date :ows_Description Ernesto MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 04-08-2010 08:08 AM In reply to tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact Hi Ernesto,I did it and copied the data and row node, here are the XPaths:For tablesrc: /xml/rs:dataFor rowsrc: /xml/rs:data/z:rowIf 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.RegardsTobias 04-08-2010 11:27 AM In reply to ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 04-09-2010 12:33 AM In reply to tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 04-12-2010 12:41 AM In reply to tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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.RegardsTobias 04-12-2010 07:45 AM In reply to ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 04-13-2010 12:36 AM In reply to tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Re: Question for CopyTable command with seconday data source DataSource.png Mark as Not AnswerMark as Answer... Reply Contact Hi Ernesto,yes, I attached the screenshot of the main and secondary data source to this reply. I hope these pictures are enough?RegardsTobias 04-13-2010 04:55 AM In reply to ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 04-13-2010 05:53 AM In reply to tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 lotTobias 04-13-2010 06:11 AM In reply to ErnestoM Joined on 08-27-2007 Posts 3,320 Re: Question for CopyTable command with seconday data source Mark as Not AnswerMark as Answer... Reply Contact 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 MachadoQdabra® Software/ InfoPathDev.comThe InfoPath Experts – Streamline data gathering to turn process into knowledge.™ 04-13-2010 07:48 AM In reply to tobiasa Joined on 04-08-2010 Vienna, Austria Posts 11 Re: Question for CopyTable command with seconday data source MainDataSource2.png Mark as Not AnswerMark as Answer... Reply Contact 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.
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 DecDateThen 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_DescriptionNow 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=yesBut 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=yesAnd 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 thanksTobiasPS: I'm sorry if the english is not so perfect, my native language is German.
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.
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_DescriptionFor 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.RegardsTobias
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 DecDatexml rs:data z:row :ows_ID :ows_LinkTitle :ows_Decision_x0020_Date :ows_Description
Hi Ernesto,I did it and copied the data and row node, here are the XPaths:For tablesrc: /xml/rs:dataFor rowsrc: /xml/rs:data/z:rowIf 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.RegardsTobias
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!
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
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:
Could you verify if copying attributes to attributes will work for you?Thanks.
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.RegardsTobias
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.
Hi Ernesto,yes, I attached the screenshot of the main and secondary data source to this reply. I hope these pictures are enough?RegardsTobias
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.
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.
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?