cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rowlinx
Level: Powered On

Need an alternative to BrowseGallery1.Selected in an editform

 

Under the item section, if I keep the BrowseGallery1.Selected as is, the screen navigates to the most recently selected entry on the browse screen.

When I remove (BrowseGallery1.Selected) the screen goes blank after I click save (SubmitForm(NewForm1)).

 

How can I have it so that the screen stays on the same record when the submit form function is run. So when a user is in this new entry screen they should be able to save without exiting the edit form screen. Like the difference between save, and save and quit. 

 

 

Capture.PNG

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Need an alternative to BrowseGallery1.Selected in an editform

Wait I typed the wrong thing.

 

Patch('proptest#2', BrowseGallery1.LastSubmit, {Proposal_x0020_Number:ID+1699974}) should be 

Patch('proptest#2', New_Form.LastSubmit, {Proposal_x0020_Number:New_Form.LastSubmit.ID+1699974})

 

You need to use the form name not the browser name.

View solution in original post

28 REPLIES 28
Anonymous
Not applicable

Re: Need an alternative to BrowseGallery1.Selected in an editform

You can set the OnSuccess property to "EditForm(YourForm)." This will reload the form as an edit form with the updated properites.edit.PNG

rowlinx
Level: Powered On

Re: Need an alternative to BrowseGallery1.Selected in an editform

Capture.PNG

 

thanks for the quick response, unfortunately this solution runs into the same problem where nothing shows up after I submit the form.

Anonymous
Not applicable

Re: Need an alternative to BrowseGallery1.Selected in an editform

 
Anonymous
Not applicable

Re: Need an alternative to BrowseGallery1.Selected in an editform

Ok, now I see your problem.

1. In Screen "OnVisible" UpdateContext({CurItem:BrowseGallery1.Selected})

2. In the form set "Item" = "CurItem"

3. In the form "OnSuccess" UpdateContext({CurItem:BrowseGallery1.LastSubmit})

rowlinx
Level: Powered On

Re: Need an alternative to BrowseGallery1.Selected in an editform

Capture.PNG

 

Hmm I'm getting an error for the item and OnSuccess for the form but the OnVisible for the screen shows no error

Anonymous
Not applicable

Re: Need an alternative to BrowseGallery1.Selected in an editform

What does the error say?

rowlinx
Level: Powered On

Re: Need an alternative to BrowseGallery1.Selected in an editform

Item: "The property expects Record values, but this rule produces incompatible Error values"

 

On Success: "The types of the specified context variables are incompatible with the types specified elsewhere"

Anonymous
Not applicable

Re: Need an alternative to BrowseGallery1.Selected in an editform

Hmmmm that is odd. I just tried it and it worked for me....

 

Maybe you could try this.

 

1. In Screen "OnVisible" UpdateContext({CurItem: LookUp( DataSource, BrowseGallery1.Selected.ID = ID})

2. In the form set "Item" = "CurItem"

3. In the form "OnSuccess" UpdateContext({CurItem: LookUp( DataSource, BrowseGallery1.LastSubmit.ID = ID)})

 

Where "ID" is the unique identifier for in the data source. This may fix the problem because it garentees that both records have the exact same schema.

rowlinx
Level: Powered On

Re: Need an alternative to BrowseGallery1.Selected in an editform

I wondered why it works for you and not for me so I created a new autogenerated powerapp but the problem prevails. Perhaps it`s something that comes with the auto generated app that I haven`t caught to erase. 

I tried your second solution and now thers is an error on the OnSuccess of the form saying "Invalid argument type." Was I supposed to switch DataSource to the name of my data source? I tried doing it both ways 

 

For the screen I added a bracket and changed the datasource to my datasource for it to get rid of the error "Invalid argument type" so for the OnVisible property I used

UpdateContext({CurItem: LookUp( proptest2, BrowseGallery1.Selected.ID = ID)})

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,433)