cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Donna_S
Level: Powered On

Help with new and edit forms

Hi guys,

 

I am a total newbie here. I have an app which is used by managers and employees for filling out reviews. Everything is good but i have a new request to add an additional screen to the managers section of the app. 

They want to be abe to 'pull up' their direct report and then add notes about the employee as the year goes on. 

 

So i thought if i had a gallery puling up their directs with this formula 

SortByColumns(Office365Users.DirectReports(First(Employee).Id),"DisplayName",Ascending)

I could then make them fill out a form from a sharepoint list and save it. 

 

How do i do this? I need the form to keep the data and it needs to change to the user, when they click on a different direct report? 

 

Appreciate any help! 

 

Thanks

13 REPLIES 13
Dual Super User
Dual Super User

Re: Help with new and edit forms

Hi @Donna_S 

 

If you want to update the item in edit form based on gallery selected item, then you need to update the "Item" property of the Edit form as:
 
LookUp(DataSource, EmployeeName = gallery1.Selected.DisplayName)
 
Here, this will populate the form with the gallery selected item when the form is in edit mode. I am assuming that the datasource is storing has a column "EmployeeName" to store the records for specific employee and hence lookup is used to pull that specific record.
 
Now, if this differs, please share more details about the schema of datasource and the items property of the edit form.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support Team
Community Support Team

Re: Help with new and edit forms

Hi @Donna_S ,

Could you please share a bit more about your scenario?

Do you want to populate your Edit form based on the direct report you selected within the Gallery?

Further, could you please share a bit more about the Employee that you mentioned within your Office365Users.DirectReports() formula? Is it a Person type column in your SP list data source?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items propety of the Gallery (Gallery1) to following:

SortByColumns(
Office365Users.DirectReports(First(Employee).Id),
"DisplayName",
Ascending
)

The standard formula as below:

SortByColumns(
              Office365Users.DirectReports("The User principal name or Email address of a specific Manager"),
              "DisplayName",
              Ascending
)

 

If you want to fill out a Edit form with values from above Gallery (Gallery1), please take a try with the following workaround:

Set the Text property of the Text Input box within the Data card in Edit form to following:

Gallery1.Selected.DisplayName
Gallery1.Selected.Department
Gallery1.Selected.Id
Gallery1.Selected.Mail

...

 

If you want to populate the Edit form with corresponding record from your SP list based on the selected direct report within above Gallery, please set the Item proeprty of the Edit form to following:

LookUp('YourSPList', EmployeeNameColumn = Gallery1.Selected.DisplayName)

If the EmployeeNameColumn is a Person type column in your SP list, please modify above formula as below:

LookUp('YourSPList', EmployeeNameColumn.DisplayName = Gallery1.Selected.DisplayName)

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Donna_S
Level: Powered On

Re: Help with new and edit forms

Thanks for yur repsponse. Sorry i havent privided enough information, i will try again and add a screenshot. 

 

The screen will be used by over 30 managers so they must only see thier direct reports. Their direct reoprt are not in the sharepoint list because there is a lot of organisational changes in the company.

 

The employee is a collection which in hindsight i should have named loggedinuser. The collection is 

ClearCollect(
Employee,
Office365Users.MyProfile()
)

 

If you look at the screenshot you will see there is a gallery on the left which uses the following SortByColumns(
Office365Users.DirectReports(First(Employee).Id),
"DisplayName",
Ascending)

 

Then on the right you will see the form. All they need is a giant text box to write notes about the employee. The direct Report text box auto populates when they click on a user in the gallery.
If an employee has no notes then it would be a new form but if the manager already written notes about that employee then i would need it to bring those notes up and have the ability to add more text to the current notes. This is where i have issues.

powerapp.PNG

I'm not sure this is even possible, sorry i am very new to this and appreciate any feedback! Thank you 🙂

Dual Super User
Dual Super User

Re: Help with new and edit forms

Hi @Donna_S 

 

Where do you want to store the comments for a specific reportee? If this is stored in a collection, the data is just available for current session and it will be wiped out when the user refreshes the browser.
 
So, I am expecting that you have a list/entity where you want to store the comments. now, the Edit Form item property should point to the same list/entity. 
 
Assumption: 
List Name -> Reportee Comments
Comuns:
Employee -> Person Type
Comments -> Multi line of text
 
The configurations for the gallery:
 
OnSelect -> If(CountRows(Filter('Reportee Comments',Employee.DisplayName = Gallery2.Selected.DisplayName)) = 0,NewForm(Form1))
 
Edit Form -> Items -> Reportee Comments
Item -> LookUp('Reportee Comments',Employee.DisplayName = Gallery2.Selected.DisplayName)
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Donna_S
Level: Powered On

Re: Help with new and edit forms

Thanks @yashag2255 for your reply, i really appreciate all the help! You are right, it is connected to a list.

 

Your solution almost works but i'm not sure if i am doing something wrong, i am filling out the notes, submitting to the list, but then it doesnt load the notes back up if i navigate back to the notes.

 

This is what i have in the items property of the form -

LookUp('Manager Notes','Direct Report'.DisplayName=Gallery1_1.Selected.DisplayName)

 

and this is the gallery on select -

If(CountRows(Filter('Manager Notes','Direct Report'.DisplayName = Gallery1_1.Selected.DisplayName)) = 0,NewForm(Form1_1))

 

Thanks!

Dual Super User
Dual Super User

Re: Help with new and edit forms

Hi @Donna_S 

 

Can you update your expression on the OnSelect property of gallery as:
 
If(CountRows(Filter('Manager Notes','Direct Report'.DisplayName = Gallery1_1.Selected.DisplayName)) = 0,NewForm(Form1_1),EditForm(Form1_1))
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Donna_S
Level: Powered On

Re: Help with new and edit forms

Thanks @yashag2255 but it still does not pull back the notes that were saved into the list. I need the form to pull in the data that was already submitted and allow the manager to continually update it

Dual Super User
Dual Super User

Re: Help with new and edit forms

Hi @Donna_S 

 

Can you please confirm if it is showing an edit form for the item that exists already? I am not sure why this is happening there but we can debug this together. Can you please check the default property of the datacard and confirm if this is referring to correct attribute.
 
Secondly, please share a screenshot of the screen where you are trying to edit an already saved record.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Donna_S
Level: Powered On

Re: Help with new and edit forms

Hi @yashag2255 

There are no items when i go into the notes section. Even though i enter data, press submit, i then go back to the manager notes screen and it doesnt pull back the notes that i entered.

 

When i click on the data card for the notes i have ThisItem.Notes which relates to a field in the SharePoint list.

1.PNGAdding the text and pressing sumbit2.PNGConfirmation3.PNGNavigate back to the screen and the data doesnt pull through

Thanks

Donna

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,999)