How to add existing field information to a newly a

2019-08-11 08:59发布

How to pre-fill new fields in a InfoPath form base on the old fields, when I add a fields to a form.

In my InfoPath form I have a field name called: "Description". Now I added another field called: "SummaryDescription". Which is suppose to take the first 10 words from the Description field.

Even though I added field and the logic, the existing form data in SharePoint Database does not get modified.


Edit

@PatrickPitre

Thank you very much for the quick response.

I'm dealing with a web-based InfoPath form (Forms Services). Yes I do have Visual Studio 2008 installed in my computer.

One of the things I need to do is to modify existing web-based InfoPath form, which is to add three more fields to the old one. Once I add the fields I need to make sure those newly added fields are not blank when the user click on the existing form that is already in the Sharepoint. I have to take the first 200 words in the existing field say "Description" and plug it into the new field "SummaryDescription".

What I have done so far:

  1. I added those three new fields to the web-based InfoPath form and published into one the test server. I'm able to view the newly added fields in the existing form.

  2. I'm trying to use the Rule in the InfoPath to help me achieve what I need to do. I check whether or not the newly added fields are blank or not. If it is then take the fields in "SummaryDescription" and add the value of .

This is the code:

concat(
substring((string-length(Description)), 1, ((string-length(Description)) <= 200) * (string-length(Description))), 
substring(number(201), 1, (not(string-length(Description))) * number(201))
) 

But I'm not able to add the value to the field at all.

This is the screen shot of what I did.

enter image description here

I have tried many different ways. And I'm pretty sure "SummaryDescription" is blank but I just could not get the value to display

What do I mean by "Sharepoint Database"? I thought that everything in the web-based InfoPath form is store in some kind of Database. Correct me if I'm wrong.

Thank you very much.

1条回答
欢心
2楼-- · 2019-08-11 09:15

Just by extending the schema and logic of an InfoPath form doesn't mean any pre-existing data (filled forms) will be automagically upgraded.

You have several options

  • Process the existing XML forms with XSLT or a custom upgrade application to transform the XML;
  • Make use of the VersionUpgrade event in the form's code-behind to perform any upgrade steps.

The principal difference is that in the first case you can make a batch upgrade, while in the latter case it's case-by-case on-demand upon opening an existing form.

查看更多
登录 后发表回答