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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display newly created ...
Power Apps
Unanswered

Display newly created data in view mode on the same screen

(0) ShareShare
ReportReport
Posted on by

I have a home Screen that has a content gallery(GalContentDtls) - where I can click a specific record, that will navigate to the content screen form where I can view or edit the record. All of this seem to work fine to me.

My issue is that when submitting a newly created data in the content Form, my content screen shows the FIRST already existing data from my Content gallery list from Home Screen. How do I get the form to display the newly created data instead?

 

When adding a new data in the content form(edit mode) and clicking on submit button, I want the form to display the newly created data in ViewMode on the same Content Screen instead of navigating it to a new success screen. 


Here is my content form and submit button code below:

ContentForm :
itemProperty: GalContentDtls.Selected

DefaultMode: formMode:View
OnSuccess: ResetForm(contentForm);ViewForm(ContentForm);Navigate(ContentScreen)

SubmitButton :

OnSelect: SubmitForm(ContentForm);

 

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,484 on at

    Hey @Heisshena 

     

    You can comment your current expressions and use the following expressions:

    To display the newly created data in the content form after submitting, you can modify the OnSuccess property of the form and the OnSelect property of the Submit button as follows:

    ContentForm:

    • Set the DefaultMode property to "FormMode.View" to display the form in View mode initially.
    • Remove the OnSuccess property.

    SubmitButton:

    • In the OnSelect property, update the formula to submit the form data and then refresh the gallery to display the newly created data.
    • After submitting the form, set the form's Item property to the newly created data.
    • Set the form's Mode property to "FormMode.View" to switch to View mode.

    Here's the updated code for the ContentForm and SubmitButton:

    ContentForm:

    • DefaultMode: FormMode.View
    • Remove the OnSuccess property

    SubmitButton: OnSelect:

    • SubmitForm(ContentForm);
    • Refresh(GalContentDtls);
    • Set(ContentForm.Item, Last(GalContentDtls).Result);
    • Set(ContentForm.Mode, FormMode.View)

    With these changes, after submitting the form, the gallery will be refreshed to show the newly created data, and the form will automatically switch to View mode, displaying the newly created data.

     

     

    I hope this helps 🙂

  • Heisshena Profile Picture
    on at

    Hi @Sundeep_Malik ,

    Thank you for your help. I'm fairly new to using PowerApps. I updated my form and button with your changes, but with the code below, it's giving me errors 'the function 'Last' has some invalid arguments'

    • Set(ContentForm.Item, Last(GalContentDtls).Result);

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard