cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
khedir
Helper I
Helper I

SharepointIntegration.Selectedlistitemid not being updating when adding a new item

Dear all,

 

i have a sharepoint list that i modified with Power Apps.

 

As you can see in the first image, when i view one of the items, i have a label that reflects the ID for that item. which i get using

SharepointIntegration.Selectedlistitemid

 

1.PNG

 

In my galley, i filter the requested items based on that same id.

 

However, when i try to add a new item after exiting the previous item. the selected list item id remains the same as you can see in the second image.

 

2.PNG

 

this will cause the gallery to still show requested items from the last item.

 

how do i reset this?

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for your reply. I will try your way. What i ended up doing is creating a variable and using it instead of sharepointintegration. OnView and OnEdit events, i set it to be equal to SharepointIntegration.Selected. However, OnNew, i set it to blank, which works fine.

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @khedir :

I've made a test and encountered the same problem you mentioned.

When I create a new record, the value of SharePointIntegration.Selected.ID is still the ID of the record I selected before.

I suggest you use this method to capture the ID of a record you recently submitted:

 

First(
  Sort(
     YourSPList,
     Modified,
     Descending
  )
).ID

 

You can add it to your submit button. Every time you submit a record, save the ID of the record to a variable, and then call this variable to get the ID of the record you just submitted.

25.gif

Best Regards,

Bof

Thank you for your reply. I will try your way. What i ended up doing is creating a variable and using it instead of sharepointintegration. OnView and OnEdit events, i set it to be equal to SharepointIntegration.Selected. However, OnNew, i set it to blank, which works fine.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

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