how to capture the "initial value" of a control - InfoPath Dev
in

InfoPath Dev

how to capture the "initial value" of a control

Last post 04-28-2020 08:13 AM by ipisors. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-27-2020 01:40 PM

    how to capture the "initial value" of a control

    I have a drop down control where whenever it is Changed, then a hidden Section becomes visible; the hidden Section has a Change Justification box. All is well, however, the users have asked me what if they Change the control- and then Change it right back to what it was before, hence it wasn't really "changed" they were just fingering around, they don't want to have to enter the change justification. It seems like I could capture this if only I knew what the value of the drop down was when the form first opened. Is there any way to do this - or can you think of any other solution here?
  • 04-27-2020 02:13 PM In reply to

    Re: how to capture the "initial value" of a control

    Sure - you can add a form load rule and a helper field for this. In the form load rules, set the helper field to the value of the form when it was opened. Does that make sense?
    Hilary Stoupa

  • 04-27-2020 02:44 PM In reply to

    Re: how to capture the "initial value" of a control

    Yes, that was very helpful! I did not know about form load rules until now. Thank you! My current situation is that: - I save the value of control1 in the form load event to a control1_initialvalue field - I save the value of control2 in the form load event to a control2_initialvalue field - I have the formatting Rule of a section (change justification) set to be Hidden, as long as control1 = control1_initialvalue, and, control2=control2_initialvalue At this point the weird thing is, it works great in Preview mode. I go to control1, for example (a drop down) and it initially says Yes. The hidden section is hidden. Then I change control1 to No, and the hidden section becomes unhidden. I change control1 back to Yes, and the hidden section becomes re-hidden. However, when I go to edit an item on the list, it doesn't behave like that. The latter part of the logic doesn't seem to execute. if I change control1, then the hidden section becomes unhidden. But if I change it back to what it was initially when the form loaded, then the hidden section fails to become hidden again. Any idea what might cause a difference like this between preview and live? And is there a way to create a post here that includes line breaks?
  • 04-27-2020 02:51 PM In reply to

    Re: how to capture the "initial value" of a control

    The post formatting is awful, right? The forum runs on pretty old software and you'll have better luck if you use Internet Explorer to post. The first thing to check would be if your form is set to update existing XML - it could be the form is set to "do nothing" so your new fields aren't getting added to existing forms. That is under the File menu > Info > Advanced Form Options in the Versioning category.
    Hilary Stoupa

  • 04-27-2020 03:05 PM In reply to

    Re: how to capture the "initial value" of a control

    Ok I checked that and it was not set to do nothing, it was set to automatically ........
  • 04-27-2020 03:08 PM In reply to

    Re: how to capture the "initial value" of a control

    Without seeing the form or any of the existing filled out XML I can't really guess. I do know that in general when it looks my rules aren't working, it is because something is not the value I think it is. Perhaps put all the fields you are using on your form where you can see them and then walk through it with an existing form again and you'll be able to see what's going on a bit better. :)
    Hilary Stoupa

  • 04-28-2020 08:13 AM In reply to

    Re: how to capture the "initial value" of a control

    Ok, thanks for your help thus far, much appreciated.
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.