cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rajesh
Advocate II
Advocate II

Update SharePoint form fields with null values

Hi

 

I've a SharePoint list with quite a few fields. Fields are a mix of multiline text and choice fields. Instead of showing all these fields in a single form, I've split them to show in multiple forms. User experience is wizard based and based on the answers in the current form, next set of questions are shown in the subsequent form. Users can navigate back and forth between these forms. I use PATCH function to update the SharePoint list with all the form data

 

Say there are 3 forms. Form 1 is mandatory. Form 2 is shown based on the options selected in Form 1. Similarly Form 3 is shown based on answers in Form 2. The user journey can end in Form1 itself or in Form2 or Form3 and they click submit button from one of these 3 forms. 

 

Form 1 Submit button  - Patch('My Form',{ID:ItemID} ,Form1.Updates)

Form 2 Submit button  - Patch('My Form',{ID:ItemID} ,Form1.Updates,Form2.Updates)

Form 3 Submit button  - Patch('My Form',{ID:ItemID} ,Form1.Updates, Form2.Updates,Form3.Updates)

 

Supposing the first time user goes through all the 3 forms and submits data at the end of form 3. I can see all the field data from 3 forms getting saved into SharePoint list. Say user comes back and edits the data, makes some different selection in Form 2 which makes the Form 3 no longer applicable and hence the user journey ends in Form2. When user clicks on submits data in Form2, I can see the updated data from the fields in Form1 and Form 2 in SharePoint, but the previously entered data for the fields in Form 3 are not removed. I would like them to be removed as they are no longer valid.

 

I've tried this approach by changing the submit function in Form 2, but that hasn't worked

ResetForm(Form3);Patch('My Form',{ID:ItemID} ,Form1.Updates,Form2.Updates,Form3.Updates)

 

Any suggestion please?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rajesh
Advocate II
Advocate II

I've managed to solve this by turning on experimental features in app settings(formula level error management) and changing the submit function in form2 as below

 

NewForm(Form3);Patch('My Form',{ID:ItemID} ,Form1.Updates,Form2.Updates,Form3.Updates)

 

Pls refer this link for more on experimental features

https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

View solution in original post

1 REPLY 1
Rajesh
Advocate II
Advocate II

I've managed to solve this by turning on experimental features in app settings(formula level error management) and changing the submit function in form2 as below

 

NewForm(Form3);Patch('My Form',{ID:ItemID} ,Form1.Updates,Form2.Updates,Form3.Updates)

 

Pls refer this link for more on experimental features

https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,133)