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 / Submit form returns to...
Power Apps
Unanswered

Submit form returns to screen with incorrect data.

(0) ShareShare
ReportReport
Posted on by 105

Hi

 

I'm having trouble submitting a form and then getting PowerApp to go return to a screen and show the correct data. Source is a Sharepoint List.

 

The main screen is a list of sites which has a groupby assigned to it.

GroupBy('Equipment Testing',"SiteName","GroupbySiteName"

AM1974_1-1692180682410.png

 

The next screen (ItemSelection) is a list of equipment based at each site. This has a filter function.

Filter('Equipment Testing',Site=Gallery1.Selected.SiteName)

AM1974_2-1692180729224.png

 

The next screen is a form which shows whatever is selected from the ItemSelection screen above. This is view only.

AM1974_3-1692180850601.png

Then final screen is a copy of the above but editable with a submit button with the following code.

SubmitForm(EditForm);Navigate(ItemSelection)

AM1974_4-1692181297990.png

However, upon submission, it returns to the ItemSelection screen but always shows data relating to Allanson Street site and not the site I am working on.

 

Why is it doing this and how do I get it to show the information (Items) I need. If I update an Item for Ashurst, I want it to go back to the ItemSelection screen and show Ashursts items, not Allanson Street.

 

Any help much appreciated.

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,565 Most Valuable Professional on at

    Hi @AM1974 ,

    I assume the field is called SiteName (not Site) and the second Gallery Items would be

    Filter(
     'Equipment Testing',
     SiteName = Gallery1.Selected.SiteName
    )

    You have not posted the Items of the two Forms, but it should be something like (assuming the second gallery name here)

    Lookup(
     'Equipment Testing',
     ID = Gallery2.Selected.ID
    )

    However I have another suggestion here - OnSelect of Gallery2

    Set(
     gblRecord,
     ThisItem
    )

    and the Item of both Forms

    Lookup(
     'Equipment Testing',
     ID = gblRecord.ID
    )

    This should retain the current worked on record until you select another one from the gallery.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • AM1974 Profile Picture
    105 on at

    Hi thanks for your help but I'm a bit lost with your suggestions.

     

    AM1974_0-1692188314332.png

     

    AM1974_4-1692188882178.png

     

    AM1974_2-1692188481623.png

    AM1974_3-1692188571868.png

     

    OnSelect for the tick is set to SubmitForm(EditForm);Navigate(ItemSelection)

     

    I'm lost as to where I put the code you suggested. Could you explain further please. Is there any more information you need?

     

    Thanks

  • AM1974 Profile Picture
    105 on at

    OK. Got it working with the Lookup on both Items on the Forms but it still does exactly the same. Returns to ItemSelection screen for and always goes back to Items relating to Allanson Street (first site on the groupby).

     

    If I got rid of Allanson Street, therefore Ashurst is the first site, the app would always return back to ItemSelection screen and show all items relating to Ashurst.

  • AM1974 Profile Picture
    105 on at

    Hi

     

    Also got it working with gblRecord option and same thing happens.

     

    I've noticed, Allanson Street seems to be in bold all the time as though its 'selected', could this be anything to do with it?

     

    thanks

     

    thanks

  • WarrenBelz Profile Picture
    155,565 Most Valuable Professional on at

    @AM1974 ,

    The code is for the Item of the Forms with two options depending on whether you want to use a Variable when you select from the gallery.

  • AM1974 Profile Picture
    105 on at

    Hi

     

    Yes I've put the code on the forms but it doesn't resolve the issue.

     

    thanks

  • WarrenBelz Profile Picture
    155,565 Most Valuable Professional on at

    @AM1974 ,

    Something strange - put this on a Label

    gblRecord.ID

    and see if it is the ID of the item chosen in the gallery. If so then the Item on the Forms of

    Lookup(
     'Equipment Testing',
     ID = gblRecord.ID
    )

    should display that record until you select another record from the gallery.

  • AM1974 Profile Picture
    105 on at

    I'm really sorry but totally lost now. I put a label on each screen (gblRecord.ID), in a blue box.

     

    After selecting the relevant site, this is what I see on ItemSelection screen.

     

    The ID of the record is in orange.

    AM1974_1-1692259679680.png

     

    If I select Testing Again (ID14) go the the next screen, this is what I get.

     

    AM1974_2-1692259904551.png

     

    If I click back to go the the previous screen, all the gblRecord.ID are set to 14.

    AM1974_3-1692259989308.png

    I've obviously gone wrong somewhere with your advice, but know where.

     

  • WarrenBelz Profile Picture
    155,565 Most Valuable Professional on at

    @AM1974 ,

    I will try to explain the logic here and you might work what you are doing wrong - I use this structure on practically everything involving Forms. When you select an item from a Gallery OnSelect

    Set(
     gblRecord,
     ThisItem
    )

    you are setting a Record Variable gblRecord (it contains all the fields of the record chosen). The Variable will retain the same value unless you change it by selecting another record.

    Then the Item of any Form based on the same data source 'Equipment Testing' as the gallery

    Lookup(
     'Equipment Testing',
     ID = gblRecord.ID
    )

    will display the record chosen as the ID is a field in the Record Variable you have set. It is a very simple, reliable and fundamental process just needs to be set when you select a record from a gallery. I assume OnSelect of the Gallery is the only place you are setting it ?

     

  • AM1974 Profile Picture
    105 on at

    Hi

     

    I really appreciate your patience with me on this.

     

    Gallery1

     

    Items

    AM1974_2-1692261985838.png

     

    OnSelect

    AM1974_0-1692261875026.png

     

    Gallery2

     

    Items

    AM1974_3-1692262044489.png

     

    Onselect

    AM1974_1-1692261933350.png

     

    Form1 (DisplayForm)

     

    Item

    AM1974_4-1692262124871.png

     

    Form2 (EditForm)

    AM1974_5-1692262219281.png

     

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 404

#2
timl Profile Picture

timl 344 Super User 2026 Season 1

#3
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

Last 30 days Overall leaderboard