How to block duplicate submission? - InfoPath Dev
in

InfoPath Dev

How to block duplicate submission?

Last post 11-11-2015 02:09 PM by Hilary Stoupa. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-29-2015 01:38 PM

    How to block duplicate submission?

    Hello again,

    Is there a way to not to allow submission if a set of data already submitted to a SP (2013) doc lib based on some keys. Any steps-by steps would very appreciate all the helps.

  • 06-29-2015 02:13 PM In reply to

    Re: How to block duplicate submission?

     I think you could do this by having a check as part of your submit rules.

    1. Make sure you have promoted all the fields that you wish to check for to prevent duplicates
    2. Add a data connection to the form library, receive, don't run the query on load
    3. In your submit rules, set query fields in the data connection created in 2 to the values you wish to check for and run the query
    4. If any rows are returned in the data connection, you can stop your rule execution and perhaps set a field's value with an error message you can display to the user. 
    Hilary Stoupa

  • 06-30-2015 09:23 AM In reply to

    Re: How to block duplicate submission?

    Thanks. That's what I am afraid that I have to do, conceptually.
  • 11-11-2015 10:04 AM In reply to

    Re: How to block duplicate submission?

     Hilary -

    I've been working on a registration page for multiple events that I've been trying to figure out how to block duplicates also. I can get the registrations to submit with a unique title, but being new to InfoPath and SharePoint - I'm getting stuck on the Submit Rule. While I could just enforce the unique title, that gives an error to end users and I'd rather send them to a view that tells them they are already signed up for the event.

    I know that I'm missing something on the Rules -

    • Rule 1
    • Condition - None
    • Run Actions - Set Field Value - (I'm setting the value to be what I use to create the title upon submission -  concat(Name, "EventID", EventID) 
    • Run Actions - Query for  Data (I select the location that the submissions go to)

    Once I get here, I'm not sure what is the next thing to do. I know that if I stop here, it doesn't work and I can submit to the same event five times and end up with five same titles.

    Is it easy to tell what I'm missing in this process? Any help would be appreciated.

    Michelle 

     

  • 11-11-2015 12:37 PM In reply to

    Re: How to block duplicate submission?

    So - I'm not sure what you are querying? You would want to query the form library for something unique (I guess the field you are using for the title, to see if there is a match?) and then you should be able to count the returned rows and do something if there is a match - like switch views and not submit....
    Hilary Stoupa

  • 11-11-2015 01:33 PM In reply to

    Re: How to block duplicate submission?

    On my SharePoint site, I have two lists

    Event

    • Event Title
    • Event ID

    Attendee

    • Title (created by combines their name with Event ID from Event Table)
    • Name (with InfoPath it's automatically pulling using REST to get User Profile Info)
    • Event ID

    I've tried on the Form Submit to set rules up to look back at the Title on Attendee Table and switch the view if it already exists.  If anything, in my attempts to figure this out on my own, I've probably confused myself more than anything.

    The last attempt I had the Form Submit Rules

    Rule 1 - Check for Duplicates

    • Condition: None
    • Action 1 - Set  a field's value
      • Field: (from Main Data Source) - Title
      • Value: (from Main Data Source) - Title
    • Action 2 - Query for Data
      • Data Connection - Attendees
    • Action 3 - Set a field's value
      • Field: (from Main Data Source) - Duplicate
      • Value: (From Attendees) - Insert Formula - count(Title from Attendees's queryFields)

    Rule 2 - Switch View

    • Condition: When Duplicate is not blank
    • Action  - Switch View to Already Registered

    Rule 3 - Submit using Data Connection

     

    In this situation, I got the "Already Registered" view even though there is no entry with that title in the Attendee List.  

  • 11-11-2015 02:09 PM In reply to

    Re: How to block duplicate submission?

    I think that you have two possible issues here - action 1, you are setting the main data source Title to itself? That confuses me. :-) Then, in action 2, you are querying for ALL the items in Attendees - so if there are any forms in the library at all, you'll get a false positive. Maybe set the Query "Title" field in the Attendees data connection to the Title in your current form before running the query, so you only get a row back if there is a match? Drag the query and data fields from your Attendees data source onto your form so you can see them. Add a button that queries the Attendees data source (this is just so you can try some stuff and see what works). Then you can experiment with setting the Title field and running the query to see what is returned.
    Hilary Stoupa

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.