Set fields value in new form based on previously inputted value. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Set fields value in new form based on previously inputted value.

Last post 08-03-2018 08:49 AM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-25-2018 08:46 AM

    • Maddie
    • Not Ranked
    • Joined on 07-19-2018
    • Posts 4

    Set fields value in new form based on previously inputted value.

     I have a form with a button to add more data. When the user presses the button, the entry is submitted a new form opens. I want some of the fields in the new form to contain the same information entered in the previous form. Is there a way to do this using rules or a function in InfoPath?

     

    Thank you in advance. 

  • 07-26-2018 07:53 AM In reply to

    Re: Set fields value in new form based on previously inputted value.

    With code, you could use input parameters, but I also wonder - what if you just query the library for the forms submitted by the same user, and then pre-populate with the most recent data? You could sort the returned data by created date... maybe have a button in the form to let the user choose to pre-populate the data, and then you wouldn't need code?
    Hilary Stoupa

  • 08-02-2018 01:08 PM In reply to

    • Maddie
    • Not Ranked
    • Joined on 07-19-2018
    • Posts 4

    Re: Set fields value in new form based on previously inputted value.

     Can you elaborate more on what that code would look like? Do you have an example? How would I start? Where could I research this topic more?

  • 08-02-2018 01:55 PM In reply to

    Re: Set fields value in new form based on previously inputted value.

    If you mean setting a default instead of using a rule, you could start w/ what you are already using - just in the field's properties, set a default value. https://support.office.com/en-us/article/set-the-default-values-for-a-form-d1ffca72-fd68-4775-af6d-7d998df536b2 has more on that.
    Hilary Stoupa

  • 08-02-2018 02:06 PM In reply to

    • Maddie
    • Not Ranked
    • Joined on 07-19-2018
    • Posts 4

    Re: Set fields value in new form based on previously inputted value.

    Yes but how would I set a default value based on past input that has already been submitted? This value is subject to change but we want it prepopulated in the new form if the user clicks the add more button.

  • 08-03-2018 08:49 AM In reply to

    Re: Set fields value in new form based on previously inputted value.

    I'm so sorry, I had this thread confused with another - no wonder my last reply made no sense! Here's a blog post on using input parameters: https://blogs.msdn.microsoft.com/infopath/2007/02/26/passing-data-into-a-form-input-parameters/ - if code isn't an option (like if this is Office 365, or your SharePoint admins don't allow browser forms with code) my other thought would be promoting all the fields with data you need and then on opening a new form, run a query in the form load rules for the last form for that user in the library, and use rules to populate values.
    Hilary Stoupa

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