cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
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!

Highlighted
Community Support
Community Support

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.
Highlighted
Regular Visitor

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 🙂

Highlighted
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!
Highlighted
Regular Visitor

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!

Highlighted
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!
Highlighted
Regular Visitor

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

Highlighted
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!
Highlighted
Regular Visitor

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.

Adding the text and pressing sumbitAdding the text and pressing sumbitConfirmationConfirmationNavigate back to the screen and the data doesnt pull throughNavigate back to the screen and the data doesnt pull through

Thanks

Donna

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,851)