cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Heisa
New Member

Set fields to blank from different form

Hi,

I am creating a wizard like app with multiple forms.

Based on a choice field, the correct form is opened and when filled in, saved to a Sharepoint List using Patch.

 

The problem is in edit mode, when the choice field is altered, I need to set the already filled in form to blank (all fields in the form).

Without opening the the already filled in form.

 

I tried using the OnReset event to set the fields to blank.

But when I execute Patch on the datasource, the fields are not set to blank.

 

Is it impossible to set fields to blank from another form? Or is it mandatory to open the form to be able to Patch the datasource?

 

Thanks in advance.

 

UPDATE:

 

Maybe a little more context helps.

 

When I open the form from a browsegallery in edit mode, I first reset all forms.

Then I save the recordset in a variable.

 

 

 

Set(
    varFormData,
    ThisItem
);

 

 

 

The item property in the forms is set to varFormData.

On each form there is a Submit button to Patch the recordset.
I want to set all fields in the other forms to blank and then do the Patch.

 

 

 

Patch(
    'recordset',
    varFormData,
    Form1.Updates,
    Form2.Updates,
    Form3.Updates

);

 

 

 

But the list in Sharepoint still has the old values, are not set to blank.

1 ACCEPTED SOLUTION

Accepted Solutions
Heisa
New Member

Figured it out.

 

Do a ResetForm and then needed to change the default event from the fields of the other forms. 

And declare a variable to store which form needs to saved. 

If it was another form, then set the field to "".

 

 

If(
    varSoort <> "ThisForm" And varFormMode = FormMode.Edit,
    "",
    Parent.Default    
)

 

View solution in original post

5 REPLIES 5
Ramon031
Helper I
Helper I

When you patch the data of the form you can use the ResetForm function:

 

OnSelect = ResetForm(<Nameofyourform>)

 It will set all the datafields to their default value

Hi, 

 

Thanks.

 

I am in edit mode when I want to set the fields to blank.

The fields I want to set to blank already contain a value. When I do a ResetForm, it will default to this value, not to empty/blank?

 

Regards

Ramon031
Helper I
Helper I

It will set them to the default value, if the the defaultvalue is blank/emtpy ResetForm will set those fields to blank/empty

The fields are not blank, so ResetForm will not work.

 

Maybe a little more context helps.

 

When I open the form from a browsegallery in edit mode, I first reset all forms.

Then I save the recordset in a variable.

 

Set(
    varFormData,
    ThisItem
);

 

The item property in the forms is set to varFormData.

On each form there is a Submit button to Patch the recordset.
I want to set all fields in the other forms to blank and then do the Patch.

 

Patch(
    'recordset',
    varFormData,
    Form1.Updates,
    Form2.Updates,
    Form3.Updates

);

 

But the list in Sharepoint still has the old values, are not set to blank.

 

Heisa
New Member

Figured it out.

 

Do a ResetForm and then needed to change the default event from the fields of the other forms. 

And declare a variable to store which form needs to saved. 

If it was another form, then set the field to "".

 

 

If(
    varSoort <> "ThisForm" And varFormMode = FormMode.Edit,
    "",
    Parent.Default    
)

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,920)