?
Solved

Infopath rules and query a data connection to capture form ID

Posted on 2013-11-18
7
Medium Priority
?
2,915 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

777 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