cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Navigate to the next item after form submission

I have an app that has a gallery and takes you to the item when you click on it. This is the onselect of the gallery - If(!IsBlank(LookUp(UATListData, StepID=Text(BrowseGallery1.Selected.C1)&& Name_=varUser)),Navigate('Form Screen',ScreenTransition.CoverRight,{locMode:FormMode.Edit,locItem:LookUp(UATListData, StepID=Text(BrowseGallery1.Selected.C1)&& Name_=varUser)}), Navigate('Form Screen',ScreenTransition.CoverRight,{locMode:FormMode.New,locItem:Blank()})). The form that the gallery navigates into has a DefaultMode of locMode and Item is locItem, currently the onsucess is set to Set(CurrentRec, formData.LastSubmit). I want to go to the next item when the submit button is hit. I have tried to do this by using the id number and adding one but have not had success. Is it possible to go to the next item within the form?

1 REPLY 1
WarrenBelz
Super User
Super User

@powerapps890 ,

I am not entirely clear what you are asking as the the "next item", but this should be the next one based on the ID

With(
   {
      wData:
      LookUp(
         UATListData, 
         StepID=Text(ThisItem.C1)&& Name_=varUser
      )
   },
   Navigate(
      'Form Screen',
      ScreenTransition.CoverRight,
      If(
         !IsBlank(wData.ID),
         {
            locMode:FormMode.Edit,
            locItem:wData.ID + 1
         },
         {
            locMode:FormMode.New,
            locItem:Blank()
         }
      )
   )
)

also your OnSuccess

Set(
   CurrentRec, 
   Self.LastSubmit
)

though I am not sure how CurrentRec relates to locItem as one is the ID (a numeric value) and the other is a record (so CurrentRec.ID would be the same thing)

 

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.

 

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,237)