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 / How to ReEdit submitte...
Power Apps
Unanswered

How to ReEdit submitted forms? - 2 Forms Associated by a number column - to be shown on same screen for edit when I select a Form from a gallery

(0) ShareShare
ReportReport
Posted on by 520

So I have 2 forms, one called Invoice (where we introduce one invoice at a item), and one called Items (where we introduce multiple items from the invoice). Now after submitting those forms, I made a gallery for the Invoice forms to be viewed. When selecting an Invoice from that gallery I want to be send to a screen where I can edit both the Invoice form and the Items form.
What I did:

For the Invoice form, I created the form, DataSource - InvoiceList, Items - InvoiceGallery.Selected;
it shows the form selected and can be edited, but how can I put on the same screen the Items form related to that invoice form selected?
PS: the forms are associated together with a column called InvoiceNumber that.s from the Invoice form, formula :ForAll(colItems,
If(!IsBlank(Title),
Patch(S2IM_InvoiceItems, Defaults(S2IM_InvoiceItems),
{Title:Title, Price:Price, VAT:VAT, InvoiceNumber2:InvoiceForm.LastSubmit.InvoiceNumber})))
Any help?

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Robert94 

    First, your ForAll formula is backward.  

    You are trying to use it like a ForLoop in some development language - which PowerApps is not.  It is a function that returns a table of records based on your iteration table and record schema.

    It is more efficient to use the function as intended and will also provide better performance.

    Formula should be:

    Patch(S2IM_InvoiceItems, 
     ForAll(colItems As _item,
     Patch(_item, {InvoiceNumber2: InvoiceForm.LastSubmit.InvoiceNumber})
     )
    )

    The above *should* be based on your primary key - I can only assume you already have the key in the static snapshot collection.

     

    As for the Invoice Items, your relationship is between InvoiceNumber2 and the InvoiceNumber.  You will not be able to display a Form with Items as a Form only deals with an Item.  You can use any other control that actually has an Items property to display the Invoice items.  And for that Item property, you can utilize a formula such as this:  Filter(S2IM_InvoiceItems, InvoiceNumber2 = InvoiceGallery.Selected.InvoiceNumber)'

     

    I hope this is helpful for you.

     

     

  • Robert94 Profile Picture
    520 on at

    So, I made the Items to be viewed and edited in a gallery using your filter formula, but after editing them, how can I save, saving them in a collection again will not update my rows, will just add others, isn.t that right?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Robert94 

    Not if you are editing.  If the form has a valid record and is in Edit mode, then you will be saving with the SubmitForm function on that form.  It will then update the existing record.

  • Robert94 Profile Picture
    520 on at

    Let.s recap please because I don.t get how I can save.
    So from the InvoiceGallery I select one item, after selecting I have 2 screens available, one where I can edit the InvoiceForm on a form and one screen where I can edit the ItemsForm on a gallery instead of a form. Now how do I Submit those Items that I am editing on the gallery to the Sharepoint List (ofcourse together with the InvoiceForm) ?

    I am new to this so thank you for your patience.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Robert94 

    First - is this post related to your other post?

     

    Next, Submitting the form would be like any other form.  Typically if you are chaining submits, you would do this based on the success of the first submit.

     

    Where are you getting stumped? If you have any particular formulas or screenshots to share to enhance your description, please feel free to share.

  • Robert94 Profile Picture
    520 on at

    Yes, I am trying to reedit and save them.
    I.ll upload here an image with detail on what works and what I want to make it work.

    If you can.t see because of the resolution being shrinked I uploaded it here    ibb.co/njBB2pC

    EditInvoice.jpg

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard