Question

I am trying to plan the auto-generated custom item name for Form library in a 2013 publishing website project.

In other words, I don't want our users to enter the name of the form every time they create an item.

We have multiple form libraries in the site. We need to use the following format:

<FormName> [ID: <ItemId>]

e.g. Car Insurance Request [ID: 573489]

where the ItemId is the one which SP created internally when item is created,

How to automatically set the name with desired format?

Was it helpful?

Solution 2

I had to create a retrieve data connection, FetchID, to fetch the ID column.

Then in submit data connection, I used this formula:

xdMath:Eval(xdMath:Max(xdXDocument:GetDOM("FetchID")/dfs:myFields/dfs:dataField‌​s/d:SharePointListItem_RW/d:ID), 'concat("Car Insurance Request [ID: ", (d:ID or 0) + 1, "]")'). 

Hopefully it will help someone.

OTHER TIPS

In your InfoPath form create a data connection with type: Submit Data, while creating it, system will ask for the Document Library and select the doucment library and next to that you will get a field called "File Name" with expression button, Click on the Expression button and there you can specify the formula/Expression to specify how the file names should be. Then Click Next, then finish and then Publish your Infopath form to the Library.

Then in the document library, if you create a document using this InfoPath form, then the file name for the created forms will be as per the Formula/Expression mentioned in the created data connection.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top