How to Display a Text Box IF DirectReports Exist

  • How to Display a Text Box IF DirectReports Exist

    Posted by DSC Communities on June 15, 2022 at 4:01 pm
    • Christopher West

      Member

      June 15, 2022 at 4:01 PM

      Hi,

      I’m trying to get a text box to appear within a gallery item but only if the selectable person has Direct Reports (people reporting to him/her). If the person was selected, and no one appeared as a direct report, then that person would not have direct reports. Essentially how the App works is that, if the person shown in the dark green box has Direct Reports, they appear in the bottom section in the light green boxes. If no Direct Reports exist, there will be no light green boxes (see the attached images – info redacted due to pulling from an Active Directory – PII). The blue box just shows the manager for the dark green box employee (not important for what I’m trying to do).

      I’m trying to make it so if someone in the light green area has Direct Reports, a text box will appear in their box that says something like “Click Here to View Direct Reports”. If they don’t have any, then the box would just be blank/invisible.Ā 

      I’m trying to set up the bottom section so that the equation always applies (not “OnClick”). The equation used to pull in the Direct Reports is “Office365Users.DirectReportsV2(varTopManager).value” (minus the quotes). varTopManager is a variable that is defined on App Start that simply says that a specific person is the TopManager so that the dark green box knows where to start in the Org Chart. The variable updates as each light green person is selected to the person that is selected.

      This is the video I was watching that helped me set up the app (minus the text box appearing if Direct Reports exist – that’s all on me): Power Apps Org Chart – How to Build Tutorial – YouTube

      I’m new to PowerApps, and I wasn’t great at coding in high school (still am not), so trying to troubleshoot code to make it look for Direct Reports for a “ThisItem” or possibly a “Parent” item is difficult for me.

      This is the code I was trying to use in the text box: “If(IsBlank(Office365Users.DirectReportsV2(ThisItem.userPrincipalName).value),”Click to View Subordinates”,””)” (no outside quotes).

      The text box propagates to all other light green direct reports if they are present, since it’s a Gallery item.

      Direct Report Issue

      ——————————
      Christopher West
      ——————————

    • Guy Boswell

      Member

      July 4, 2022 at 8:31 AM

      Hi
      Hate to see an unanswered query but don’t have the whole answer.Ā  If I was you I would be thinking of counting the number of direct reports and displaying the direct reports gallery if the count greater than zero
      Good luck
      GUy
      ?

      ——————————
      Guy Boswell
      Care for the Family
      Newport
      02920810800
      ——————————
      ——————————————-

    • Warren Belz

      Member

      July 11, 2022 at 2:53 AM

      Hi ,
      This structure

      CountRows(
         Office365Users.DirectReportsV2(varTopManager).value
      ) > 0?

      will return true or false depending where the person has direct reports or not

      ?

      ——————————
      Warren Belz
      Queensland Australia
      ——————————
      ——————————————-

    DSC Communities replied 3 years, 2 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘How to Display a Text Box IF DirectReports Exist’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!