cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jcvizconde
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
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
shailendra74 Solution Sage
Solution Sage

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.

 

jcvizconde
Regular Visitor

Re: RequestHide Function on SP List

Hi @shailendra74 

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

 

shailendra74 Solution Sage
Solution Sage

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.

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

jcvizconde
Regular Visitor

Re: RequestHide Function on SP List

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

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

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