
Hi
I have a SharePoint integrated form and while I'm using edit forms for some of the data, I'm using text inputs that patch to my source for other parts. The issue I'm having is that creating a new form displays the values of the text inputs from my last viewed entry.
For example, I have a text input called AttendeesTextInput that patches perfectly fine to my data source in a column called 'Attendees'.
The default value for the text input is SharePointIntegration.Selected.Attendees.
When I click new form (and I have ResetForm in it although it doesn't apply since that column is not part of the form), the text input shows that value of 'Attendees' from the last entry that I viewed.
I've tried messing with the reset function of the text input, which is supposed to reset it to its default value. My question is - If a New entry doesn't have values for any columns (since it's new), why is it showing the value of the last view entry. Creating a variable that resets the text input just resets it back to default of being SharePointIntegration.Selected. Attendee, but for the last entry.
Has anyone had this issue before? I don't know how a new form can referenced anything using SharePointIntegration.Selected from the previous entry.
The behavior you are experiencing in your Power Apps form is likely due to the way SharePointIntegration.Selected works and how the form data is managed. When you navigate between items or open the form for a new entry, the SharePointIntegration.Selected variable retains the value of the last selected item. As a result, when you open a new form, the text input defaulting to SharePointIntegration.Selected.Attendees will show the value of the previous item's 'Attendees' column.
To address this issue, you can modify the default value of the text input so that it behaves correctly when a new form is opened. Instead of using SharePointIntegration.Selected.Attendees as the default value, you can use the Defaults function to set the default value based on the field's data type.
Here's how you can do it:
1. Determine the data type of the 'Attendees' column in your SharePoint list. It could be Single line of text, Person, or something else.
2. For Single line of text columns:
Default: ""
3. For Person columns:
Default: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims: "", DisplayName: "", Email: "", Picture: "", Department: "" }
Note: The default value for a Person column is an empty record of the SPListExpandedUser data type.
By using the Defaults function with the appropriate data type, the text input will be properly reset to its default value when opening a new form, and it won't display the value from the previous entry.
If you still encounter issues with the text input not resetting correctly, you can try using a variable to control the default value. For example:
Default: If(IsNewForm, Defaults('Your SharePoint List'), SharePointIntegration.Selected.Attendees)
Here, the IsNewForm function checks if the form is in "new" mode, and if it is, it sets the default value to the appropriate Defaults function for your data type. If it's not a new form, it uses SharePointIntegration.Selected.Attendees as the default value.