cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Applasaurus
Helper I
Helper I

Submit Form - New Claim to Sharepoint list

I've created a claim form for users to complete and submit. When they click the Submit button the completed form should be created in Claim_Entry sharepoint list with the StatusID set To PEN, but nothing is populating in the Sharepoint list (Help!)

 

Here is the code that OnSelect for Submit button:

 

SubmitForm(frmNewClaim);({StatusID: "PEN"});
Navigate(ScrSubmitSuccess);
ResetForm(frmNewClaim)

1 ACCEPTED SOLUTION

Accepted Solutions

OK @Applasaurus ,

It is becoming a bit clearer now, Setting a variable by itself will have no effect on the data - you have to write it to the data.

So assuming you have a SharePoint field called StatusID and you want it updated to PEN when you write the record, try this.

Add the data card for the StatusID field into your form - you can hide it if you want to. Change the Update properties of the card to "PEN". This should submit this value with the card when submitted.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

10 REPLIES 10
WarrenBelz
Super User
Super User

Hi @Applasaurus ,

Why are you resetting the frmNewClaim after submitting?

Also what is the context variable {StatusID: "PEN"} doing?

Also you need to Refresh the data source before anything on ScrSubmitSuccess will reflect what you have just submitted.

To test your issue, try this on the OnSelect of the save button

SubmitForm(frmNewClaim);
Refresh(Claim_Entry);
Navigate(ScrSubmitSuccess)

and see if this solves your issue - we will deal with the Variable after this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @WarrenBelz 

 

Thanks for the code, I entered it in OnSelect but it didn't update the sharepoint List. 

 

I reset the form so that it's blank after submitting, do I not want to do this if the form is submitted?

 

Setting the status ID to PEN on submission is to update the status in Sharepoint, and the PEN status is a filter set when the line manager opens the app for their approval/rejection.

Thanks @Applasaurus ,

We might try drilling down a bit further - what is the code opening the new form and where is it initiated from?

Also there is no need to reset a new form after submission if you are navigating away from it.

The button on th main menu navigates to the new claim screen, DataSource for the form is Claim_Entry Sharepoint List and the Default Mode is NEW

Ok thanks - just looking for unobvious issues - does the code say NewForm(FormName)?

Also - just covering bases - have you also refreshed and checked the SharePoint list in SharePoint to check that the item is not there - I have had issues at times with PowerApps in development mode not refreshing properly.

@WarrenBelzThe code worked to send the submittion to the sharepoint list but the status ID needs to be set to PEN - Pending within the sharepoint list, I've tried using {StatusID: "PEN"} but I'm guessing it's incorrect as it's not doing anything to the list.

OK @Applasaurus ,

It is becoming a bit clearer now, Setting a variable by itself will have no effect on the data - you have to write it to the data.

So assuming you have a SharePoint field called StatusID and you want it updated to PEN when you write the record, try this.

Add the data card for the StatusID field into your form - you can hide it if you want to. Change the Update properties of the card to "PEN". This should submit this value with the card when submitted.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

@WarrenBelzHad a lightbulb moment and added the StatusID field into the form as you mentioned and used UpdateContext({StatusID:"PEN"}) and that's updated the status of the line in SharePoint. Thanks for your help.

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,423)