cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
steve_hendy
Resolver I
Resolver I

SharePointForm1 always shows first item in editor

steve_hendy_0-1642084465642.png

Why is the editor still showing me the first item in the list when I have a lookup in item?

 

If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),LookUp([@'Training Certificates'],ID=305),SharePointIntegration.Selected)

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@steve_hendy 

Change your Item formula to the following:

Coalesce(SharePointIntegration.Selected, LookUp('Training Certificates', ID=305))

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

10 REPLIES 10
RandyHayes
Super User
Super User

@steve_hendy 

Change your Item formula to the following:

Coalesce(SharePointIntegration.Selected, LookUp('Training Certificates', ID=305))

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
steve_hendy
Resolver I
Resolver I

What a very clever chap you are.  Thanks for the quick reply works perfectly.  I did try googling it 😀

Its stopped working now.  Its reverted back to the first item. ☹️

Maybe there is a setting interfering with it under app settings.

RandyHayes
Super User
Super User

@steve_hendy 

Based on that formula, you would have either the item selected in your list when you do a New/Edit of the item, or the record with ID 305.  It is impossible to have record 1.  So, your Selected in the list must be record 1.

 

The way Coalesce works is it returns the first non-blank parameter.  So if your SharePointIntegration.Selected has a record, that will be the one shown.  If there is no record selected (pretty much would never happen), then it would show record with ID 305.  If for some very rare reason, both are blank, then your form would show "getting data" and never display.

 

SO...your Selected is record 1 or there is something else going on in your app.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
steve_hendy
Resolver I
Resolver I

Its ID=1 

steve_hendy_0-1642093573385.png

 

RandyHayes
Super User
Super User

@steve_hendy 

Right...so then your SharePointIntegrated.Selected item is 1

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
steve_hendy
Resolver I
Resolver I

So how do I make it id=305 like the picture above?  Its the same issue in edit or view mode.

RandyHayes
Super User
Super User

@steve_hendy 

Well, I'm not really understanding your purpose then... Is the purpose of your app to always display and edit record 305?  Or is your purpose to display and edit the record selected from your list?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,105)