Determine whether an InfoPath form is for a new item or existing

Determining whether an InfoPath form is for a New or Existing item

Do you need to have a slightly different InfoPath form view depending whether you are showing an existing list item or a new entry? This turned out to be pretty straightforward. In my case I just want to show one of two submit buttons. One that said “Submit Changes” and the other that said “Submit New”, depending on whether this was a new item or existing.

I created a new formatting rule for each of the items. On one of them, I triggered the rule when the created date was empty, which indicated that the item hadn’t been created (aka “new”).

In the formatting section, I just checked the box for Hide this control. This is what I needed for my scenario.

determine new form infopath

Determine new form InfoPath

Here’s a picture of the window that comes up to help define the condition for your new formatting rule.

new infopath condition

That’s about it. You can extend this to whatever you need as you aren’t limited to just formatting rules. Events such as On Form Load can be a time to present a different behavior to users.

There you go.

 keywords: determine new form infopath

 

Leave a Reply

Your email address will not be published. Required fields are marked *