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 / Saving Forms From A Co...
Power Apps
Answered

Saving Forms From A Component

(1) ShareShare
ReportReport
Posted on by 8

Hi

 

I am trying to create a few centralised components so I do not have to keep writing the same code.  So far got most of it working but I am trying to figure out how to SubmitForm from inside a component.

 

Normal code for this would be something like this - SubmitForm(form_name)

 

Tried passing the name of the form to the component via txt input.  But Component does not like the fact it's not an editable form.

I can not see an component input for forms to pass it for submit.

The save part of the component needs to go every page so would save me a lot duplicate code.

Tried using behaviour component as well.

 

Any thoughts has anyone else done this?

Thanks

 

Categories:
I have the same question (0)
  • Verified answer
    rb Profile Picture
    835 Super User 2024 Season 1 on at

    Hi, assuming you mean the Form is outside your component, I recently authored a post which might be of help. It's the only way I've found to reliably trigger action in the Parent app from inside a component-scope: https://powerusers.microsoft.com/t5/Building-Power-Apps/navigate-in-component-context-variable/m-p/1664587/highlight/true#M423811 

     

    In your case you may have:

    Component:

    • Button OnSelect: 
      • Set(ToggleSubmitForm, false);
        Set(ToggleSubmitForm, true);
    • Output Property 'SubmitFormTrigger' with value (which will be toggled by button above):
      • ToggleSubmitForm

    App Screen

    • Add Component with name 'compSubmit_ScreenName'
    • Add Toggle with name 'toggle_SubmitForm_ScreenName'
      • Visible:
        • false
      • Default:
        • compSubmit_ScreenName.SubmitFormTrigger
      • OnCheck: 
        • SubmitForm(Form1)

    Then you can just copy the Component + Toggle to each screen you need it, and update the Form reference of your Toggle OnCheck.

    metsshan_1-1659148034792.png

     

    Let me know if this works?

  • bn_powerapps Profile Picture
    8 on at

    Thanks will take a look and see how it goes.

  • bn_powerapps Profile Picture
    8 on at

    Worked had to make a few changes but the overall idea was right.  Shame it can not be done soley within a component via inputs / outputs / behaviours.  Kind of defeats the object. 

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard