cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jcvizconde
Level: Powered On

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 Team
Community Support Team

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.
5 REPLIES 5
shailendra74
Level 8

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
Level: Powered On

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
Level 8

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 Team
Community Support Team

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.
jcvizconde
Level: Powered On

Re: RequestHide Function on SP List

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

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 59 members 4,883 guests
Please welcome our newest community members: