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

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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
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

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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
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

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 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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,287)