Need to open a screen, and populate a single-record form, using the form.LastSubmit.ID
Currently, I open the screen and populate the form from a search screen (scrSearch) that has a gallery. In the gallery is a Next button, which uses OnSelect of:
Navigate(scrObservationDetails, ScreenTransition.Fade,{selectedItem: galResults.Selected})
FACTS:
1. The data is a 1-M of Observations and ObservationItems, stored in SharePoint.
2. From scrSearch, the user can create a new Observation on scrObservationNew.
3. When a new observation is saved, a Flow is triggered to populate some ObservationItems, based on another template list.
Currently, after a new Observation is created, the user is Navigated back to the search screen (scrSearch), and then must search for the new record, then click on the Next button in the results gallery. (galResults). Need to cut out the middleman, and navigate the user straight from the new form to the detail form.
QUESTION: What is the proper Context to add to the navigate function to open a screen, and populate a single-record form, in the same way that selectedItem would?
scrObservationNew.frmObservation.OnSuccess:
Navigate(scrObservationDetails, ScreenTransition.Fade, { [?what goes here?] : frmObservation.LastSubmit.ID })
TIA
Solved! Go to Solution.
Consider a basic global variable for this.
Change your Gallery Next Button OnSelect to the following:
Set(glbCurrentRecord, ThisItem);
Navigate(scrObservationDetails, ScreenTransition.Fade)
Set the Items property of all of your Forms to glbCurrentRecord
In the OnSuccess of the Form, set the formula to the following:
Set(glbCurrentRecord, Self.LastSubmit);
Navigate(scrObservationDetails, ScreenTransition.Fade)
I hope this is helpful for you.
Consider a basic global variable for this.
Change your Gallery Next Button OnSelect to the following:
Set(glbCurrentRecord, ThisItem);
Navigate(scrObservationDetails, ScreenTransition.Fade)
Set the Items property of all of your Forms to glbCurrentRecord
In the OnSuccess of the Form, set the formula to the following:
Set(glbCurrentRecord, Self.LastSubmit);
Navigate(scrObservationDetails, ScreenTransition.Fade)
I hope this is helpful for you.
The gallery is on the Search screen. I want to go from the New screen, which doesn't have a gallery (only a form), to the Details screen. Will this technique still work?
Yes, this will still work just fine. As long as you have the Item property on the other forms set to glbCurrentRecord - you will be dealing with either the selected record from the Gallery, or from the last submitted record from the New Form.
Ok.. I use a global var for the items, so am familiar with the technique. So, that LastSubmit is the key to many locks. Thanks!
Summary Answer: Use a global var, which make a record object, using the LastSubmit construct.
ex. Set(glbCurrentRecord, Self.LastSubmit);
Yes, a variable can be anything. In this case we're just capturing the LastSubmit of the form in it and using it everywhere else needed.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
260 | |
127 | |
86 | |
85 | |
68 |