cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

RequestHide Function on SP List

I have a SP list and wants to use different screens for New and Edit. I created 1 form for New and 2 forms for Edit - since my columns does not fit a single screen.

 

Here are my values:

SharePointIntegration.OnNew - NewForm(NewForm1); Navigate(FormScreen1,None)

SharePointIntegration.OnEdit - EditForm(EditForm1); Navigate(FormScreen2,None)

SharePointIntegration.OnSave - If(FormMode = New, SubmitForm(NewForm1), Patch('SP-List',SharePointIntegration.Selected,EditForm1.Updates,EditForm2.Updates))

 

NewForm1.OnSuccess - ResetForm(NewForm1); RequestHide()

EditForm1.OnSuccess - RequestHide()

EditForm2.OnSuccess - RequestHide()

 

The data is saving, but the form does not hide nor give errors. I need to manually refresh the browser so I could view the edited fields.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: RequestHide Function on SP List

Hi @jcvizconde ,

Could you please share a bit more about your issue?

Do you mean that the issue occurs when you edit an existing record in your SP list using the EditForm1 and EditForm2?

 

Based on the issue that you mentioned, I think you have something misunderstanding on the OnSuccess property of the Edit form.

The OnSuccess property of the Edit form could only be fired when you use SubmitForm function to submit your form data. The Patch function could not fire the OnSuccess property of the Edit form.

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider modify your formula as below:

SharePointIntegration.OnNew:

Refresh('SP-List');   /* <-- Add formula here */
NewForm(NewForm1);
Navigate(FormScreen1,None)

SharePointIntegration.OnEdit:

Refresh('SP-List');    /* <-- Add formula here */
EditForm(EditForm1);
EditForm(EditForm2); /* <-- Add formula here */
Navigate(FormScreen2,None)

SharePointIntegration.OnSave:

If(
IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
SubmitForm(NewForm1),
Patch('SP-List', SharePointIntegration.Selected, EditForm1.Updates, EditForm2.Updates);ResetForm(EditForm1);ResetForm(EditForm2);RequestHide() /* <-- Modify formula here */
)

NewForm1.OnSuccess:

ResetForm(NewForm1);
RequestHide()

Please consider take a try with above solution, check if the issue is solved.

Note: I assume that the EditForm1 and EditForm2 connects to your same SP list data source, and the Item property set to following formula:

If(
IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
First('SP-List'),
SharePointIntegration.Selected
)

And you want to update an existing record in your SP list based on the EditForm1 and EditForm2 form data.

 

Also please consider check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/es-es/blog/separate-custom-forms/

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Anonymous
Not applicable

Re: RequestHide Function on SP List

Hi @jcvizconde 

 

Please refer to below query to refresh the page:

 

https://powerusers.microsoft.com/t5/General-Discussion/BUG-PowerApp-SharePoint-List-Form-not-refresh...

 

For SPIntegration > onSave try below code 

 

If(
    IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected), // new mode this is blank
    SubmitForm(SharePointForm1),
    SubmitForm(EditForm1)
)

Thanks.

 

Highlighted
Regular Visitor

Re: RequestHide Function on SP List

Hi @Anonymous 

How do I insert my EditForm2? Do I use Patch function? - When I do this, upon saving, the app does not hide.

If(
    IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected), // new mode this is blank
    SubmitForm(SharePointForm1),
    Patch('SP-List',SharePointIntegration.Selected,EditForm1.Updates,EditForm2.Updates)
)

 

Highlighted
Anonymous
Not applicable

Re: RequestHide Function on SP List

Hi @jcvizconde 

 

The Patch function need to be done as follows by providing FIELDNAME: VALUE

 

If(
    IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
    SubmitForm(SharePointForm1);
    RequestHide(),
    Patch(
        'SP LIST',
        SharePointIntegration.Selected,
        {
            //ActualHours: Value(DataCardValue23.Text),
            //EstimatedHours: Value(DataCardValue22.Text),
FIELDNAME: VALUE } ); RequestHide() )

Thanks.

Highlighted
Community Support
Community Support

Re: RequestHide Function on SP List

Hi @jcvizconde ,

Could you please share a bit more about your issue?

Do you mean that the issue occurs when you edit an existing record in your SP list using the EditForm1 and EditForm2?

 

Based on the issue that you mentioned, I think you have something misunderstanding on the OnSuccess property of the Edit form.

The OnSuccess property of the Edit form could only be fired when you use SubmitForm function to submit your form data. The Patch function could not fire the OnSuccess property of the Edit form.

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider modify your formula as below:

SharePointIntegration.OnNew:

Refresh('SP-List');   /* <-- Add formula here */
NewForm(NewForm1);
Navigate(FormScreen1,None)

SharePointIntegration.OnEdit:

Refresh('SP-List');    /* <-- Add formula here */
EditForm(EditForm1);
EditForm(EditForm2); /* <-- Add formula here */
Navigate(FormScreen2,None)

SharePointIntegration.OnSave:

If(
IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
SubmitForm(NewForm1),
Patch('SP-List', SharePointIntegration.Selected, EditForm1.Updates, EditForm2.Updates);ResetForm(EditForm1);ResetForm(EditForm2);RequestHide() /* <-- Modify formula here */
)

NewForm1.OnSuccess:

ResetForm(NewForm1);
RequestHide()

Please consider take a try with above solution, check if the issue is solved.

Note: I assume that the EditForm1 and EditForm2 connects to your same SP list data source, and the Item property set to following formula:

If(
IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
First('SP-List'),
SharePointIntegration.Selected
)

And you want to update an existing record in your SP list based on the EditForm1 and EditForm2 form data.

 

Also please consider check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/es-es/blog/separate-custom-forms/

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Regular Visitor

Re: RequestHide Function on SP List

@v-xida-msftwow thank you this one works! thank you for guidance!

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,732)