cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
freddiejoseph1
Helper II
Helper II

SharePoint lookup to populate an EditForm

Hi all,

 

I have another question about an app I am building. Currently the user enters details about work they are completing in a form and it gets submitted/patched to SharePoint. Two of the bits of information that get patched are start time and end time. If a user does not enter an end time (so no end time for the task gets patched to the sharepoint list) I would like an edit form to appear the next time they open the app which prompts them to enter an end time for the task which they didn't complete the last time they submitted an entry.

 

I think I will need to do this in two stages. I will first need to get the correct information to show in the editform which appears when the user next opens the app. I will then need to make the form/pop out visible if the end time field is blank, and I won't show anything at all if the end time field has been populated.

 

I collect the users email address which matches the user().email function in powerapps, so I can use this to filter the sharepoint list by the correct user, but I am unable to get the specific last created item by a specific user to populate in my edit form.

 

Any help would be much appreciated.

 

For reference my data source is called FinanceTimeLog and these are the different fields I wish to populate in the form. AgentID is the same as User().email. 

 

 

 
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@freddiejoseph1 

 

If you are going to make the EditForm a Pop Up on the main screen, then you can use the following concept to set that as visible (i.e. the Visible property of the form and any other items that you want to appear - label, screenblocker, etc.)

 

In the OnVisible of the screen, set a formula such as this:

With({_eml:USer().Email},
    Set(incompleteRecord,  LookUp(FinanceTimeLog, AgentID=_eml && IsBlank(EndTime))
)

Then set the Visible property on the items to : !IsBlank(incompleteRecord.ID)

And set the Item property of your form to : incompleteRecord

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@freddiejoseph1 

 

If you are going to make the EditForm a Pop Up on the main screen, then you can use the following concept to set that as visible (i.e. the Visible property of the form and any other items that you want to appear - label, screenblocker, etc.)

 

In the OnVisible of the screen, set a formula such as this:

With({_eml:USer().Email},
    Set(incompleteRecord,  LookUp(FinanceTimeLog, AgentID=_eml && IsBlank(EndTime))
)

Then set the Visible property on the items to : !IsBlank(incompleteRecord.ID)

And set the Item property of your form to : incompleteRecord

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Thank you so much. This seems to have worked!

Hi Randy. Sorry to come back to this. I am still having a few issues with this. I only want this screen blocker and form to show when the End Time is blank in my SharePoint list. I think your solution previously does make this happen. However, when I patch the form back to my SharePoint list, the blocker doesn't disappear. How can I get the blocker to disappear when the user has correctly filled out the form and clicked the continue button?

 

freddiejoseph1_0-1614246667758.png

 

Thanks,

 

Freddie

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (54,728)