Need To Prepend data to filename BEFORE it is saved to SharePoint library - InfoPath Dev
in

InfoPath Dev

Need To Prepend data to filename BEFORE it is saved to SharePoint library

Last post 12-02-2013 10:23 AM by Deeayrian. 24 replies.
Page 1 of 2 (25 items) 1 2 Next >
Sort Posts: Previous Next
  • 09-13-2012 09:41 AM

    Need To Prepend data to filename BEFORE it is saved to SharePoint library

    I have created the required elements to use the qRules Command to save an attachment to a SharePoint library,

    It works OK but I really would prefer to concatenate a field name (ICMNO - see screenshot) to the file name before it is saved to the SharePoint library. I need to maintain the original file name as well, so I don't' want to simply replace the file name with the ICMNO. Just need to stick the ICMNO in front of it.

    I actually was able to replace the file name with the ICMNO + a date/time stamp, BUT that doesn't work because the second and subsequent attachments end up with same name and obviously, I end up with ONE file.  So sticking the ICMNO field on the front end of the original file name is really the best solution.

    I just can't get there. 

    Any clues ?

    thanks!

     

    SaveToSharePoint /url=https://zzzz.web.qqq.com/eot/icm/xxxxx/ICMDOCS /xpath= /my:myFields/my:Enclosures_Messages/my:Attachments/my:Attach/my:File


    DMN
  • 09-13-2012 09:50 AM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    So, turns out I had this request just a few weeks ago, and I modified the command to handle for it. Your original trial probably doesn't have the modification, but I think we just sent you a trial with an extended due date while you were working toward purchase.

    If you inject your form with the new trial build, you will have an additional (undocumented) parameter in the SaveToSharePoint command. When v4.3 is released we'll have it documented. The param is:

    [/nameXPath=Relative XPath for name field]

    So, for your purposes, you could add another attribute to the attachment field and then you could use the GetAttachmentAttribute command to help you generate your custom file name - you can use that command to get the file name of the attachment, then use a rule concating the ICMNO + the original filename + date time stamp (be sure to remove any chars SharePoint doesn't like!). Store your custom file name in your new attribute. For the sake of discussion, we'll call it customFileName.

    Then, in your command, you could include: /nameXPath=@my:customFileName

    Does that make sense?

    Hilary Stoupa

  • 09-13-2012 10:02 AM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    yes it does. Thanks.

    I'll try it. I'm trying to expedite the purchase so I can get up to speed. I think the new trial I just loaded (with Marci's help) expired already (???) , because nothing seems to work this morning. It's always something !

    Thanks !!

     

    DMN
  • 09-13-2012 10:09 AM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    Drag the Error node from the QdabraRules data source onto the form and execute a simple command (I like GenerateGuid) - if it is expired, you'll see a message about that in the error. I know I created a build that expires 10/15 - but the previous trial should still be active till 9/15.

    More likely is that you might have accidentally added custom code to your form (it is easy to do) - you have my email, send it my way and I'll check it for you.

    Hilary Stoupa

  • 09-13-2012 10:49 AM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    I'll go in and drag that error field over as you said and get back to you. thanks.

    I really do appreciate your QUICK response. What a pleasure !!

    I’ve had nothing but good things to say about Qdabra since I first started interfacing with Patrick over the weekend. Wow! Then Marci got involved and she has been just great.  … and now you !

    I’m really impressed. I’ve already told some of my counterparts on the west coast (Long Beach) about the great customer support from Qdabra.

    OK. So the only thing that I did this morning was to add a custom control… Contact Selector.

    Would that have hosed things up?

    I went into ‘Programming’ and remove  code button is greyed out, so, I'm thinking I did not add any code.   ?

    I really am new to InfoPath, but learning quickly with all your help!

    Thanks again.

    DMN
  • 09-13-2012 11:26 AM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    A contact selector shouldn't have caused problems, and if the remove code is disabled, you most likely did not add code. Try a simple command like GenerateGuid. Just put the command field on the form (from the QdabraRules data source) and the Result and Error fields, preview, and type GenerateGuid in the Command field - tab out, what happens?

    Hilary Stoupa

  • 09-16-2012 04:23 PM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

     Thanks Hilary. I have to apologize because this environment is a bit new for me and I am not picking up on all the things you would think I should comprehend. I am pretty close but I just cannot understand the details of  HOW to use the GetAttachmentsAttribute to grab the file name so I can concatenate it to the new attribute I created for Attachment. i tried referring to the Qdabra qRules documentation but it doesn't help.see screen capture and embedded question, please.


    DMN
  • 09-16-2012 07:23 PM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

     CLOSE BUT NO CIGAR.

    So I tried to follow your instructions the best I could.

    As you can see in the illustration, I created an attribute for "Attachment" called customFileName. I then put a button on the form that I clicked each time I added a file attachment.

    Rule 1 on the button runs the GetAttachmentAttribute and grabs the Name. According to the qRules documentation,  the results get returned to the "Result" node, so

    Rule 2 set the value of the customFileName to concat(ICMfilename,Result).

    For the first file I attached... PERFECT - just what I wanted.

    BUT, the Result node did not change when I added a second attachment and clicked the button again. Therefore the second customFileName ends up the same as the first.

    So what am I doing wrong ?? I feel like I'm so close I can taste it.

    Quite frankly though, I really don't think the users are going to want or are going to remember to click a button each time they add a file.

    I just did this to see if I could get close. The end game needs to somehow get wrapped up in the SUBMIT button that takes care of the whole Magilla.

     

    thanks


    DMN
  • 09-16-2012 08:21 PM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

     THIS DID NOT WORK EITHER...

    So I thought I would put some rules on "File" and try that, thinking it would eliminate the need to click a button.

    Basically I just applied the same command but stuck it on the "File" field with the condition "File" is not blank.

    Didn't matter. Ended up with same results. The qRules Result node did not change so neither did the custom file name.

    Is there some sort of refresh or reset for the Result node ??

    I just know that you are going to come back with some really simple thing that would have saved me hours of trial and error... but what the heck... I'm learning a lot in the process.

     

     


    DMN
  • 09-17-2012 08:17 AM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    I believe Jo-Anne sent you a sample form demonstrating this technique. Did that resolve the issue for you?

    Hilary Stoupa

  • 09-17-2012 08:40 AM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

     sorry, I did not get that. Either that or I just don't know here to look... which is altogether likely.

    Where would it have been sent?

     thanks!

     

    DMN
  • 09-17-2012 02:23 PM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    I'm not finding any sample form. Where would that have been sent ?

    thanks!

    DMN
  • 09-17-2012 02:50 PM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    I replied to your email - this was in an email Jo-Anne sent directly to you.

    Hilary Stoupa

  • 09-17-2012 04:03 PM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

     well, I've checked my company email and my personal email - I'm sorry but I do not have any emails from Jo-Anne other than one from Sept. 10

    DMN
  • 09-17-2012 04:15 PM In reply to

    Re: Need To Prepend data to filename BEFORE it is saved to SharePoint library

    Did you get the email I sent you with it attached? Perhaps the file type is blocked- attaching here.

    Hilary Stoupa

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