cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Usernametwice23
Resolver I
Resolver I

On resetting a form, am I able to set the data fields in Dataverse to blank at the same time?

Hi all 

 

I am still trying to resolve my last post. 

 

I'm thinking that if I can set the data fields in Dataverse to blank upon resetting the form then I might be able to resolve it. Is this possible? Some of them are text, numeric and choice columns. I'm thinking that if I can set them to null/blank then I'll be able to reset the form and submit it again the with values I want to use. 

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Usernametwice23 ,

 

Could you please explain your scenario a bit more? Would you like to reset the form then enter and save the form as a new record or just edit the record that just submitted into Dataverse?

 

If you would like to reset the form and save the form as a new record, then:

Reset button - OnSelect - NewForm(Myform)

Form - OnReset - false

 

If you would like to edit the record that just submitted into Dataverse, then:

Reset button - OnSelect - EditForm(Myform)

Form - OnReset - false

 

If you would like to edit the record that just submitted into Dataverse but need to leave all the fields blank in the form, then:

Save button - Onselect - SubmitFrom(Myform)

Reset button - Onselect - EditForm(Myform)

Form - OnReset - false

Form - OnSuccess - Notify("success ...",NotificationType.Success);Set(varSubmit, true)

Gallery controls - OnSelect - Select(Parent);Set(varSubmit, false);EditForm(Myform)

All Form fields - DataCardValues - Default/DefaultSelectedItems - If(varSubmit, Parent.Default, Blank())

 

The point is:

1\ When EditForm the form would have values in the fields coming from the Item property of the Form

2\ When ResetForm you will only reset the form to the default mode, values would still be included in the fields if it is in Edit mode.

3\ NewForm would make all the fields blank but when submitting the form you will create a new record

4\ If you would like to make all the fields blank when in Edit mode, you will need to manually set Blank() in all the fields as the process above.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
rampprakash
Solution Sage
Solution Sage

Hello @Usernametwice23,

 

Yes you can

Add a Reset button  on top of the Form using Ribbon Workbench and trigger an Setvalue option to make the values NULL.

 

Eg

function setValuesToNull(executioncontext)

{

var formcontext = executioncontext;

formcontext.getArribute(filedLogicalName).setValue(null)

// ADD OTHER FIELDS TOO

}

 

Please Mark as Answer if it's helpful

 

Subscribe : https://youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

 

 

 

 

dpoggemann
Super User
Super User

Hi @Usernametwice23 ,

 

This is a Canvas Power App in looking at you last post correct?   Have you tried something similar to the following?

 

SubmitForm(Form1);
Set(
selectedRecord,
Blank()
);
ResetForm(Form1);

 

Hope this helps.  Please accept if answers your question or Like if helps in any way.


Thanks,


Drew

v-jefferni
Community Support
Community Support

Hi @Usernametwice23 ,

 

Could you please explain your scenario a bit more? Would you like to reset the form then enter and save the form as a new record or just edit the record that just submitted into Dataverse?

 

If you would like to reset the form and save the form as a new record, then:

Reset button - OnSelect - NewForm(Myform)

Form - OnReset - false

 

If you would like to edit the record that just submitted into Dataverse, then:

Reset button - OnSelect - EditForm(Myform)

Form - OnReset - false

 

If you would like to edit the record that just submitted into Dataverse but need to leave all the fields blank in the form, then:

Save button - Onselect - SubmitFrom(Myform)

Reset button - Onselect - EditForm(Myform)

Form - OnReset - false

Form - OnSuccess - Notify("success ...",NotificationType.Success);Set(varSubmit, true)

Gallery controls - OnSelect - Select(Parent);Set(varSubmit, false);EditForm(Myform)

All Form fields - DataCardValues - Default/DefaultSelectedItems - If(varSubmit, Parent.Default, Blank())

 

The point is:

1\ When EditForm the form would have values in the fields coming from the Item property of the Form

2\ When ResetForm you will only reset the form to the default mode, values would still be included in the fields if it is in Edit mode.

3\ NewForm would make all the fields blank but when submitting the form you will create a new record

4\ If you would like to make all the fields blank when in Edit mode, you will need to manually set Blank() in all the fields as the process above.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

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!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,234)