?
Solved

Infopath rules and query a data connection to capture form ID

Posted on 2013-11-18
7
Medium Priority
?
3,034 Views
Last Modified: 2013-12-11
I have a form working and providing a unique identifier for the form name.  I need a way to capture the unique sharepoint ID assigned to each form on submit.  One thing I read was to add a action to query the data connection before the submit and then add an action to set the fields value where the value on my form storing the generated ID will equal the value of the sharepoint assigned ID.

I have to have a unique Id for each form and my data does not lend itself to that.

Can someone explain how to do this for me.  I have tried several things and can't get it work as I am not clear on how to do it.
0
Comment
Question by:kdschool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 28

Expert Comment

by:clayfox
ID: 39657483
Not exactly sure what you mean but here is best practice if you want to track submissions.

1. Create the unique file name for submitted records / forms to SharePoint in a field in your data source.
2. Then use that field in the submit wizard for the SharePoint submit

This gives you the ability to store the name in the form. That way on subsequent opens or to check metadata is very easy.

Not sure if this is your case but some people create the unique in the data wizard but then it is not persisted in the form.

Another option is to query submits to the library and then look at created times and username of the created by, but this is not fool proof like just saving the file name inside the form.

Otherwise would need more information or examples of what you have.
0
 

Author Comment

by:kdschool
ID: 39699320
Using instructions from this URL
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/689e681f-d46a-4621-a0cf-55fd49a0432a/i-want-to-display-the-id-of-an-infopath-form-after-submission-to-a-doc-library-on-sharepoint?forum=sharepointcustomizationlegacy 

I got the form working with auto generating file name. I am confused on this step:
The next step should be an action to "Set a Field's Value."  This is where you'll want to set the value of your form's ID field to the ID node of the secondary data connection WHERE strFilename (SharePoint) is equal to strFilename (InfoPath).  Here, you are using a filter to compare the filename saved in the form to the filename saved in the form library.

I am not clear on what he is telling me to do .  I don't understand how to create the filter to compare the two files names and then return that to the form.
0
 

Author Comment

by:kdschool
ID: 39708759
I don't really understand where I should create these two items can you explain?

1. Create the unique file name for submitted records / forms to SharePoint in a field in your data source.  ( in my infopath data source or on the sharepoint library form site or both? and can I name that field anything or does it have to be ID?)

2. Then use that field in the submit wizard for the SharePoint submit .  Are you saying here to select this field after it's created when I complete the submit wizard for the submit button? Then tie the field I created to what field during this process that would show the ID for that record?
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 28

Expert Comment

by:clayfox
ID: 39708776
1. Add a field to your main data source. Name it filename. It does not need to be promoted to the library since it will be the file name (title).
Not sure how you name your files currently but would setup a rule on load with the condition that filename is blank then the action concat(ID, now()) This would set a unique file name for each record but only when it is initially started. Not sure if you have an ID like for employees, or whatever but would want a unique naming scheme. If you need to wait until right before submit to determine the name move this rule to the submit button rather than onload. Make sure to use the is blank condition, otherwise if you edit later and resave it would create a new file with a new name instead of saving over the original.

2. In the data connection wizard for submit to SharePoint, you would select the filename field for the name, and follow through the wizard.  That way the value in filename is used.
0
 

Author Comment

by:kdschool
ID: 39708799
I have it working with a unique file name concatenating date time and employee ID and each time I edit the form it writes over and when I add a new one it knows if it's blank to create a new entry.  I want to display the ID of an infopath form after I submit it to my library in sharepoint.  From what I understand that is the only really unique ID for any record.
0
 
LVL 28

Accepted Solution

by:
clayfox earned 2000 total points
ID: 39708839
If you put the concat(now(),EmpID) into a field in the form, and use that for the submit then just expose that field in your view to show the user.
There is a GUID that SharePoint generates but not sure why you would want that or the user would care.

You can also create a data connection back the library you submit to and query that if you want to double check that it was saved.

Not sure what issue you are trying to address here.  If this is just informational to the user, then I think you should be fine.  Why do you want to display the name?  So they can find it later?

Another option is to make an admin form or edit form which links to the library and can pull the promoted information. This way you can give search or a filtered list for files just from a certain employee ID, etc.

I guess one questions is I assume you are using a submit data connection and a button and not allowing users to "save" forms.  Saving is not good practice since you do not have much control whether on the initial submit or on follow up ones.
0
 

Author Comment

by:kdschool
ID: 39712313
Yes what I need is a unique name so they can not enter a duplicate form and find it easily if it they need to edit the information.  I am using a submit button.  I thought there were issues about this if you did not use the share point assigned unique ID.  It looks like those only exist if you are transferring files.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question