QRules Save attachment in to folder error - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

QRules Save attachment in to folder error

Last post 03-30-2016 07:32 AM by donstephen. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 03-21-2016 11:51 PM

    QRules Save attachment in to folder error

    Hi Team

    I had downloaded the qRules trial version and injected qrules in to template and tried the SaveToSharepoint function but getting below error.

    Required parameter unspecified: xpath. Usage is: SaveToSharePoint /url=SharePoint Library URL [/dsname=Data Source Name] /xpath=XPath to Picture(s) or Attachment(s) [/name=Name for file (extension will be added by qRules)] [/namexpath=Relative XPath for name field -- not available for /async] [/overwrite=Overwrite existing file if name is specified (yes | no) -- default is no. Not available if /dsnamews is specified.] [/async=Filler Only - upload asynchronously to prevent blocking user while filling out form (yes | no) -- default is no. Ignored if command is used in browser.] [/dsnameprog=If uploading async, data source name for progress node - defaults to Main if not specified.] [/xpathprog=If uploading async, xpath for node to report progress to. Main data source assumed if /dsnameprog not specified.] [/dsnamews=Data Connection Name for Copy web service.] [/dsurl=Site URL for Copy web service data connection. Use only if the data connection should have its url changed.] [/clear=(yes | no)- indicates whether to clear the attachment field on successful upload. Default is yes.] [/uniquename=(boolean, true by default) - Prepend date and time information to file names to provide unique names

    Formula Used : concat("SaveToSharePoint /url=", FolderURL, "/my:myFields/my:FileAttachments/my:FileAttachment/my:File /name=", Result)

    Uploaded infopath template for reference

    Thanks In Advance
    Praveen Manne
  • 03-22-2016 07:35 AM In reply to

    Re: QRules Save attachment in to folder error

    As per the error message, you have not included the /xpath parameter. I'm guessing it goes before the /my:myFields bit. concat("SaveToSharePoint /url=", FolderURL, " /xpath=/my:myFields/my:FileAttachments/my:FileAttachment/my:File /name=", Result) I'm going to guess your FileAttachment field is repeating, and warn you that you will end up with all the files named the same thing using your formula, since you are setting the name to what I assume is the qRules Result field. You may want to put the name for your files in an attribute on File, and use /namexpath instead.
    Hilary Stoupa

  • 03-23-2016 01:02 AM In reply to

    Re: QRules Save attachment in to folder error

    Yes I am using repeating FileAttachment control.

    Let me know how can I refer repeating FileAttachment xpath in below formula?

    concat("SaveToSharePoint /url=", SharePointSiteUrl(), url, "/xpath=/my:POC/my:FilesGroups/my:FilesGroup[", @rowNum, "]/my:CFile")


    Praveen Manne
  • 03-23-2016 05:40 AM In reply to

    Re: QRules Save attachment in to folder error

    Hi Praveen,

    The attached form didn't contain any logic which triggers uploading multiple attachments. So I am assuming that you are attempting to copy the upload logic from FilesGroup onto the FileAttachment group. If so, could you try the modified form attached and let us know if it works?

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 03-23-2016 06:14 AM In reply to

    Re: QRules Save attachment in to folder error

    Hi Stephen,


    not exactly, FilesGroup is my repeating attachment control using that control I should upload attachments in to the document library.

    Please find the latest attached template.
    Praveen Manne
  • 03-23-2016 11:56 PM In reply to

    Re: QRules Save attachment in to folder error

    Hi,

    I checked your form and noticed that @rowNum didn't have a count preceding-sibling function which therefore returns a blank value. Although it could be omiited by removing the @rowNum from the command line, I went ahead and added the count preceding-sibling function to the @rowNum as a default value instead .

    Please try this form and see if it works.

    If it doesn't could you try removing the dsnamews parameter and see if it would make any difference?

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 03-24-2016 04:09 AM In reply to

    Re: QRules Save attachment in to folder error

    Hi Stephen,

    Thanks for your time but No luck, I had downloaded the template and published tested in my environment.


    Repating attachment control is not working, I removed dsnanews parameter also below error message is showing

    Required parameter unspecified: xpath. Usage is: SaveToSharePoint /url=SharePoint Library URL [/dsname=Data Source Name] /xpath=XPath to Picture(s) or Attachment(s) [/name=Name for file (extension will be added by qRules)] [/namexpath=Relative X
    Praveen Manne
  • 03-24-2016 10:20 PM In reply to

    Re: QRules Save attachment in to folder error

    Hi Praveen,

    There was no space in between the url and xpath parameter, causing qRules not to find the xpath parameter. To test, I added a space in between the double quote and slash, changed the FolderURL to a test site, and removed the dsnamews. It was able to submit to the doc folder.


    Here's the formula i used:


    concat("SaveToSharePoint /url=", FolderURL, " /xpath=/my:POC/my:FilesGroups/my:FilesGroup[", @rowNum, "]/my:CFile")

     

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 03-27-2016 11:00 PM In reply to

    Re: QRules Save attachment in to folder error

    Thank you Stephen, you made my day it is working perfectly.
    Praveen Manne
  • 03-30-2016 06:50 AM In reply to

    Re: QRules Save attachment in to folder error

    Hi Stephen,

    One quick question how to add "uniquename" parameter in below command?

    since I need actual file name in document library. concat("SaveToSharePoint /url=", FolderURL, " /xpath=/my:POC/my:FilesGroups/my:FilesGroup[", @rowNum, "]/my:CFile")

    Thanks
    Praveen Manne
  • 03-30-2016 07:32 AM In reply to

    Re: QRules Save attachment in to folder error

    Hi Praveen,

    By default, qRules already generates a unique name for the attachment when uploaded, but if you want to have a more specific file attachment name, you could use the parameter /name to specify the name - you could reference this parameter to a field that would be used for generating the attachment's name when uploaded (i.e. you could use the form's unique form name when - this way it would be easy to determine which form is the attachment related to).

    But if you have multiple attachments, I would recommend adding an attachment name field to the repeating group. The question right now is how would you like to generate the unique name for each attachment? - you could display the name field on the canvas right next to to attachment control; then use that field for the /name parameter in the command. This way, whenever a file is uploaded, the attachment will automatically be named using the name field displayed.

    Or you could add a logic that automatically populates the name field based on a certain field from the form that could best identify or reference the attacment.

    I hope this helps.

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.