locked
How to capture existing filename of the uploaded into library .xml document via InfoPath tools (or else)? RRS feed

  • Question

  • I have uploaded a bunch of .xml files with data into a Document Library.
    What I'm trying to achieve here is to allow users to edit this files with the InfoPath form, without creating a new file. For this - I need to pass aelready existing filename value into a suibmit connection, instead of generating a new one.

    Is there a way to do it?

    Thanks!

    Friday, March 30, 2012 3:06 PM

Answers

  • Just add a receive data connection to get the values from Same form library where you have uploaded .xml files.

    Remember to Check "Include Data from Active form only" while creating data Connection.

    There you will get the Title (Name field is not available) of your form. you have to make sure the Title is same as Name field. (remove .xml from title if it is there).

    Now create a new field in form, let it be as FileName. Add the default value to it as "Title" from your secondary Datasource and pass it to Submit.


    Dare to promise

    • Marked as answer by Natalie Kash Friday, March 30, 2012 3:47 PM
    Friday, March 30, 2012 3:41 PM

All replies

  • If I understand correctly,

    You have to add a dataconnection which will get all the files present in the Doc Library.

    Show the Name values (.xml files) in a drop down.

    user will select which file to edit from drop down. On submit use the value of drop down.


    Dare to promise

    Friday, March 30, 2012 3:15 PM
  • NOpe. It is more simple (I guess_) than that.

    The context: initial .xml file was NOT created via submit. I uploaded it into a library. When I open it already WITHIN a library - I want to be able to make changes and keep them in the same file, without creating a new one. For this I need to capture a filename of the file i'm editing and pass it to the Submit connection as a value for a filename. If I pass any other value - it will create a new file with the "other" value, instead of over-writing the current one.  Does it make any sense?

    Friday, March 30, 2012 3:30 PM
  • Just add a receive data connection to get the values from Same form library where you have uploaded .xml files.

    Remember to Check "Include Data from Active form only" while creating data Connection.

    There you will get the Title (Name field is not available) of your form. you have to make sure the Title is same as Name field. (remove .xml from title if it is there).

    Now create a new field in form, let it be as FileName. Add the default value to it as "Title" from your secondary Datasource and pass it to Submit.


    Dare to promise

    • Marked as answer by Natalie Kash Friday, March 30, 2012 3:47 PM
    Friday, March 30, 2012 3:41 PM
  • Thanks a bunch!

    Sounds very reasonable and I'm trying it right now!

    Friday, March 30, 2012 3:48 PM
  • Sorry - one question popped up. I went though all the steps: created a connection (for active forms only) to Title field (same value as name, except for .xml extention in a Title), created a field with default to @Title, but now value is being loaded. I tried to populate a filed on form open event (instead of default value), but it didn't work eigther.

    What mighrt be wrong and what is neede to be checked?

    Thanks and sorry for being a pain!

    Friday, March 30, 2012 4:25 PM
  • Hi,

    Have you selected "Automatically retrieve data when form is opened" in Data Connection.

    Also if you are using Spaces between your file name then it will not work.

    Remove Spaces from File name and see it if it works.


    Dare to promise

    Friday, March 30, 2012 5:26 PM