cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
twister
Post Patron
Post Patron

last submit with user office365

Hi,

 

How do i make to display last submit Title with same previous created_name?

 

If Office365Users.MyProfileV2.displayName (current user) = Form1.LastSubmit.ID
will display Form1.LastSubmit.Title in TextInput from that user..

 

Objective : to get last record submited from that user from last record id.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

@twister ,

I just tested this here on a list I have with content in the Title column and got the Title of the last record I created.

With(
   {
      wRecord: 
      Sort(
         SPListName,
         ID,
         Descending
      )
   },
   Set(
      varLR,
      LookUp(
         wRecord,
         'Created By'.DisplayName = User().FullName
      ).Title
   )
)

 

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.

View solution in original post

12 REPLIES 12
WarrenBelz
Super User III
Super User III

Hi @twister ,

This will set a Variable (varLR) to the last record created by the current user

With(
   {
      wRecord: 
      Sort(
         YourSPListName,
          ID,
          Descending
      )
   },
   Set(
      varLR,
      LookUp(
         wRecord,
         'Created By'.DisplayName = User().FullName
      )
   )
)

 The fields will then be varLR.FieldName

 

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.

twister
Post Patron
Post Patron

@WarrenBelzthanks for feedback..actually im still new with this powerapps (3days). Can u explain more how to use that formula or where do I to paste that formula. because 1 got error..

 

twister_0-1613448469943.png

 

@twister ,

As mentioned in the post the actual field name is varLR.FieldName, so you just need to set it to that (whatever the field name is). If you just want to put the formula on the Default of a Text Box, use this (do not bother with the Variable)

With(
   {
      wRecord: 
      Sort(
         YourSPListName,
         ID,
         Descending
      )
   },
   LookUp(
      wRecord,
      'Created By'.DisplayName = User().FullName
   )
).ID

Is this what you are trying to display?

 

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.

twister
Post Patron
Post Patron

Solved error issue, but the data (Title) from previous record still not display.. maybe still missing any step..

 

twister_0-1613453792878.png

@twister ,

Choose View > Variables > varLR and see what is in there after you have run the code.

 

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.

twister
Post Patron
Post Patron

This output:

I insert this formula on button to create new application.

twister_0-1613459735936.png

 

WarrenBelz
Super User III
Super User III

@twister ,

You need to click on the Record icon (the purple box at the top left).

 

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.

twister
Post Patron
Post Patron

This button right? Nothing happen when i click or mouseover on the table icon (looks like not a button)

twister_0-1613465728084.png

 

@twister ,

I just tested this here on a list I have with content in the Title column and got the Title of the last record I created.

With(
   {
      wRecord: 
      Sort(
         SPListName,
         ID,
         Descending
      )
   },
   Set(
      varLR,
      LookUp(
         wRecord,
         'Created By'.DisplayName = User().FullName
      ).Title
   )
)

 

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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,962)