web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with new and edit...
Power Apps
Unanswered

Help with new and edit forms

(0) ShareShare
ReportReport
Posted on by 12

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

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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!

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    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,

  • Donna_S Profile Picture
    12 on at

    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 🙂

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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 Profile Picture
    12 on at

    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!

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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 Profile Picture
    12 on at

    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

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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 Profile Picture
    12 on at

    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

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Donna_S 

     

    Can you confirm if the "item" property of the form is set to LookUp(DataSource, EmployeeName = gallery1.Selected.DisplayName)?
     
    To fetch the records from existing items, this property is used.
     
    Also, can you create a temporary label and check on the Text property use the expression:
    Text(Form1.Mode)
     
    If this is 0, this meand the form is in edit mode and if it is 1 then the form mode is new. So, now can you check the form mode for the already created items? Please reply back with the results and we can debug this together.
     
    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard