I have a form to record visitor details and after submitting the form I want most fields to clear, but the "Host" and "Visiting Site" fields to retain their values as this info will always be the same for the session and dont want to have to keep retyping the "Host" and "Visiting Site" details.
The only time the "Host" and "Visiting Site" fields should be cleared is when the "Restart" button is selected. How can i clear most fields, but keep "Host" & "Visiting Site" populated when the form is submitted?
Thanks in advance,
Hello @mdevaney ,
Your solution above works wonderfully. I am having trouble getting a combo box to retain the last submit form info. Any tricks to that specific input type?
If someone is still looking for a solution on this...
Just add the following (with brackets and everything) to the defaultselecteditems property. I was adding only to the default property, but since the field is a combobox it needs to go to the latter instead.
That should solve your problem.
[Parent.Default]
I am becoming a little bit confused here. It might be time to start a new topic and rexplain the problem now that you've solved the 1st one. Sorry.
Hi, do you know why its adding the last submitted entry for "Host", but not "Visiting Site"? The "Visiting Site" sharepoint list type is "Choice", if that makes a difference?
I have also been trying to follow your example and display the CurrentVisitngSite value in a lablel, but current trying to figure out the code.
Hi, I managed to get the "Host" one working, i simply removed/re-entered your code. But oddly the"Visiting Site" combo box doesnt display the current value? see attached.
The code I am using is...
Set(CurrentVisitingSite,Visitor_Registration_Form.LastSubmit.Visiting_x0020_Site); or
Set(CurrentVisitingSite,Visitor_Registration_Form.LastSubmit.VisitingSite); (this is how the sharepoint list column is named)
I also removed the line
NewForm(Visitor_Registration_Form);
as this was preventing the form data from showing in the gallery.
I have also been trying to set the "DisplayMode" of the host field to "view", using the code
"If(IsBlank(CurrentHost), DataCardValue14_1.DisplayMode.View, DataCardValue14_1.DisplayMode.Edit);"
But also cant get that to work.
Thanks in advance,
"Thanks for taking the time to supply an alternative solution. I done as you suggested and the code was accepted (no red crosses), but upon pressing the "Submit" button, the details are not submitting it to the sharepoint list and the gallery on the form, they just stay showing on the form. Any ideas?"
I want to know why the form is not submitting. Please create a label with this code in it. Does any error appear in this label after you click submit?
Form1.Error
So ultimately, what I want to achieve is that no matter how many rows are added for the current session, the "Host" and "VisitingSite" details will always be the same as row 1.
Another option, would be to disable the "Host" and "VisitingSite" combo boxes if 1 record has already been submitted and then pre-populate the "Host" and "VisitingSite" values of any additional rows with the "Host" & "VisitingSite" values found in the first row? Don't know if that would be easier? Hope that makes sense.
Thanks for taking the time to supply an alternative solution. I done as you suggested and the code was accepted (no red crosses), but upon pressing the "Submit" button, the details are not submitting it to the sharepoint list and the gallery on the form, they just stay showing on the form.
Any ideas?
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional