web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / LastSubmit not working
Power Apps
Answered

LastSubmit not working

(0) ShareShare
ReportReport
Posted on by 101

I'm developing a powerapps applicaiton using SQL Azure DB.

In my scenario I have a list with consultations, when they click on a record they can edit, otherwise the users can create a new consultation. During a consultation they also need to take pictures and go to a camera screen. For this I need to know the last submitted record id.

 

From my create/edit screen I have a button that goed to the camera page using the following command: 

 

SubmitForm(frmIPLSkinRejuvTestPatch) && Set(SkiRID;frmIPLSkinRejuvTestPatch.LastSubmit) && Navigate(ScrSkinRejuvTreatmentImages;ScreenTransition.Fade;{TTImageType:"Before";SRTreatmentType:"IPL";LastId:frmIPLSkinRejuvTestPatch.LastSubmit.SkinRejuvIPLId})

As you can see I set a global variable and a context vaiable, this is for testing purposes..On the camera screen I have a label having the following code as Text property, to see what value is populated:

Concatenate("SRID: ";Text(SKinRID.SkinRejuvIPLId);" - Last submit: ";Text(frmIPLSkinRejuvTestPatch.LastSubmit.SkinRejuvIPLId);" - Last ID: ";Text(LastId))

In this label the only value I see is the SRID (global variable), but has an incorrect value (from previous case). This was not updated by the LastSubmit.

 

//Update 1

When I add the Id field to the form, the LastSubmit function seems to work, only in when the formmode == NewForm. When the mode is EditForm it has no effect. - still not the required result. Am I doing something wrong?

 

Any idea?

 

Categories:
I have the same question (0)
  • JanSomers91 Profile Picture
    32 on at

    When you submit a form that is in Formmode.new it automatically changes to formmode.edit.

    Why are you using ' && ' instead of ' ; ' ?

  • SvenV Profile Picture
    101 on at

    This I have now used for the "new item"-button: 

     

    Set(SKinRID;IPLSkinRejuvTestPatchList.Selected);;Navigate(ScrIPLSkinRejuvTestPatchCard; Fade) ;; ResetForm(frmIPLSkinRejuvTestPatch) ;; NewForm(frmIPLSkinRejuvTestPatch)

    This I have now for my "edit item"-button

     

    EditForm(frmIPLSkinRejuvTestPatch) ;; Set(SKinRID;IPLSkinRejuvTestPatchList.Selected) ;; Navigate(ScrIPLSkinRejuvTestPatchCard; ScreenTransition.Fade)

    Did this have any effect? No..for the new item it always populates the LastSubmit after a submitform, for the edit item it does not 😞

  • Verified answer
    v-micsh-msft Profile Picture
    on at

    Hi @SvenV,

     

    Please switch the Submitform function and the set function as below:

    SubmitForm(frmIPLSkinRejuvTestPatch) ;; Set(SkiRID;frmIPLSkinRejuvTestPatch.LastSubmit) ;; Navigate(ScrSkinRejuvTreatmentImages;ScreenTransition.Fade;{TTImageType:"Before";SRTreatmentType:"IPL";LastId:frmIPLSkinRejuvTestPatch.LastSubmit.SkinRejuvIPLId})

    Switch the && with ;;   

    Using && would execute the formula in parallel, while the submitform is executing, there is no LastSubmit record could be referenced.

    The Set function and the Navigate function should execute after the SubmitForm function.

    Adding some reference:

    Edit form and Display form controls in PowerApps

     

    Regards,

    Michael

  • MihirY Profile Picture
    129 on at

    I am also facing same issue. What is the resolution for your solution?

    Once I submit the form, I want to navigate user to another screen, with Lastsubmit data. Is it possible?

  • alex3 Profile Picture
    48 on at
    Did you find a solution for this issue?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard