web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / When form is New Reset it
Power Apps
Answered

When form is New Reset it

(1) ShareShare
ReportReport
Posted on by 559

Hi All,

I have a gallery which based on the Project name navigates to the screen which has a form. I am using the same form for New and Edit form. On select of the gallery I have a code:

Set(
varproject,
LookUp(
'Project Review List',
'Project Name' = TextInput8.Text,
'Project Name'
)
);
If(
Is Blank(varproject),
Newform(Form2),
Edit Form(Form2)
);
Navigate('ProjectReview_New Screen');

 

and on the Form Item Property I have given a code: 

LookUp(
'Project Review List',
'Project Name' = Gallery6.Selected. Project Name
)

and the Default mode of the Form is Edit since I'm using the same form for Edit and New. The error which I am facing is when I select a project called "Ridley " it if exists in SharePoint list it navigates to the Edit form or else New form. Edit form is working fine. When I edit few details for the Ridley project and submit it gets saved to the SharePoint . And the next time again I navigate for the next project called CBRE it reflects the saved value from the Ridley Project. Only if I go back to the gallery page and navigate again to the form it Resets the form or else it shows the previous saved values. I tried to write the Reset form on the Visible property of the screen where the Form is it gives me "No item to display" message when I navigate from gallery. 

 

Ay help/ suggestion on this would be greatly appreciated.

Thanks in advance.

Categories:
I have the same question (0)
  • Verified answer
    gcmfaizan Profile Picture
    1,022 on at

    Hi @Uthhra ,

     

    try this formula on the DisplayMode property of your form instead set the Display mode of from on another screen:

    If(IsBlank(varproject), FormMode.New, FormMode.Edit)

    and can add logic to reset the form when you navigate to it from the gallery. Add the following formula to the OnVisible property of the form screen:

    ResetForm(Form2)

     

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks!

     

  • Sri Profile Picture
    559 on at

    Hi @gcmfaizan ,

    It is working but when I submit the form it has to stay in the same page for further details to be entered. So I'm getting No items to display for some few seconds and then It resets the form since Reset Form code is written onVisible.

  • gcmfaizan Profile Picture
    1,022 on at

    If you want to navigate back to the screen where you use the gallery, so for this use

    Back()

    function OnSuccess property of the form.  an OnVisible property of this screen uses the Refresh function

    Refresh('Project Review List')

    to refresh the data source.

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks!

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @Uthhra ,

     

    Maybe you can try this, set the On Success of the Form2:

     

    Set(var1,Form2.LastSubmit.'Project Name')

     

    vmengmlimsft_0-1692609172689.png

     

    Set the Item of the Form2:

     

    LookUp(' 'Project Review List', 'Project Name'=var1)

     

    vmengmlimsft_1-1692609172691.png

     

    Best regards,

    Rimmon Li

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard