Manager Hierarchy - InfoPath Dev
in

InfoPath Dev

Manager Hierarchy

Last post 10-04-2012 06:09 AM by BejeweledOne. 27 replies.
Page 1 of 2 (28 items) 1 2 Next >
Sort Posts: Previous Next
  • 08-28-2012 08:29 AM

    Manager Hierarchy

    If this has been asked before, I have not been able to find it so here goes.

    This is my scenario -

    I have a request form. The employee field is a people picker and I have the manager populating from that information. I would like to have a drop down list that gets populated with the names of the next 2 managers in the hierarchy. This will allow the employee to choose one if their manager is unavailable.

    How would I go about setting this up using the information that I already have populating into the form (employee, manager)? I have qrules injected into the form already if that is the solution.

    Filed under: ,
  • 08-30-2012 06:07 AM In reply to

    Hi-

    As far as I know, People Picker just selects the one user (employee, from your description above).

    How will the form obtain the information to determine who are the "next two managers in the hierarchy"? Is this populated via a SharePoint list, via Active Directory? You would need this information available in a secondary data source so that you can populate the dropdown with that info.

    How are you getting the employee's manager right now? Could that be extended to retrieve the other manager's information?

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 08-30-2012 06:21 AM In reply to

    Yes, the People Picker only retrieves the single employee, but I have another field set to use the value of the People Picker field and I have a rule that queries the UserProfileService to obtain the manager of the employee listed in the People Picker. What I don't know is the easiest way to obtain the value of the next 2 higher managers and dynamically populate both of them into a drop down list that the employee can select from if their direct manager is not available.

    I am still learning all of this. Only been using infopath for about 4 or 5 months

  • 08-31-2012 05:28 AM In reply to

    Ah, I see.

    So let me ask about "2 higher managers": right now the form has my:employee and my:manager. Would my:manager2 be the manager for my:manager, and then my:manager3 be the manager for my:manager2?

    Sorry, just trying to understand what "2 higher managers" means.

    Thanks.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 08-31-2012 05:46 AM In reply to

    Yes, that is correct.

    Thanks

  • 08-31-2012 05:57 AM In reply to

    Thanks for the clarification.

    I think getting these two managers should be easy. Just like you have queried the UserProfileService to get my:manager for my:employee, you could call my:manager2 for my:manager and my:manager3 for my:manager2.

    Now, the question is: after that data is all available, how do we populate it into a dropdown. I can't think of a solution for that at the moment, but perhaps I'll think of something...

    In the meantime, can you get the data connections and rules set up to get the my:manager2 and my:manager3 info into the form? I think it should be straightforward,  following rules similar to the procedure the form uses now to get my:manager for my:employee.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 08-31-2012 06:45 AM In reply to

    Do you think it would work if I used a multi-selection list box instead of a dropdown and have the 2 fields that are capturing the manager information set that fields value after they are populated?
  • 08-31-2012 07:16 AM In reply to

    I have worked this out, and I'll explain the solution here in case anyone else needs it.

    You'll need a repeating group in your form, which you can then use as the data source for the dropdown. (So this will be my:dropdownGroupRepeating with my:dropdownField within it)

    You'll need a field for my:manager2 and my:manager3, and you'll be setting those values via a SharePoint web service.

    When the value for my:manager2 is retrieved, you simply set the my:dropdownField equal to my:manager2. (no qRules involved here)

    However, when you retrieve my:manager3, that's when qRules comes into play. You'll need to first Insert then Set Value:

    Insert /parent=/my:myFields/my:DropdownOptions /child=my:DropdownOptionsRepeating /posn=last /count=1

    concat("SetValue /xpath=/my:myFields/my:DropdownOptions/my:DropdownOptionsRepeating[2]/my:DropdownOptionField /value=", Option2)

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-27-2012 06:09 AM In reply to

    I have another scenario where this will work perfectly if it can be done. (Not using people picker so it shouldn't crash Infopath preview).

    I have 4 fields that I want to populate dynamically into a dropdown list. It is possible that up to 3 of those fields will be blank.

    Please let me know if I my logic is correct for the first step.

    1. The value of the dropdown would be set to the repeating table value

    2. Each of the 3 successive fields would have a condition that the field is not blank and then have an insert command to add a row to the table

    3. The last field would have the concat value

    If this is correct how do I format the concat command to incorporate all 4 fields?

  • 09-27-2012 09:26 AM In reply to

     The key would be to use Insert followed immediately by SetValue. You'd be inserting a new row into the repeating table (that holds the data displayed for the dropdown) then use SetValue to set the value of that newly inserted row.

    Here's the sample form in case it helps anyone else in the future. It contains a trial version of qRules, so it will need to be reinjected. But at least it can be opened in design mode to see the form logic.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-27-2012 09:42 AM In reply to

     Hi,
    Sorry, I'm not sure what you mean. Are you talking about this command?

    concat("SetValue /xpath=/my:myFields/my:DropdownOptions/my:DropdownOptionsRepeating[2]/my:DropdownOptionField /value=", Option2)

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-27-2012 09:49 AM In reply to

    Yes. Sorry I seem to be processing things slowly today......................... I realized right after I replied that I did know what you were talking about. I do have one question, In the command:

    concat("SetValue /xpath=/my:myFields/my:DropdownOptions/my:DropdownOptionsRepeating[2]/my:DropdownOptionField /value=", Option2)

    Does this value (...DropdownOptionsRepeating[2])... change at all based on what table row this data goes into?

    Sorry for so many questions, I am very new to this.......................
  • 09-27-2012 10:55 AM In reply to

    I answered my own question and yes for anyone else who needs that information, that value in the [] brackets changes to match the row number you are populating.

    I do have another question but here is the scenario to better understand.

    This is a form for requesting mobile devices. If the person selects a specific cell phone, the dropdown list populates with the available colors the phone comes in.

    So lets say I select a samsung galaxy sIII which has 3 colors. The dropdown list looks like this:

    Pebble Blue
    Garnet Red
    Black

    If I have made a mistake however and select a different model that has fewer available colors, such as the iPhone, my list looks like this

    Black
    White
    Black

    The last color from the previous selection is still populated into the list. How can I cause it to 'recalculate' and only populate the list with the correct information?

  • 09-27-2012 01:58 PM In reply to

    I'm pretty sure you would need to clear the list and rebuild it. It seems like a straightforward cascading dropdown scenario, where if you have three cascading dropdowns (for example) and you change your mind on the first one, it should have a rule to clear out the 2nd and 3rd dropdowns, since the previous selections are now invalid.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-28-2012 06:26 AM In reply to

    I agree. Since the repeating table rows are inserted dynamically wouldn't I need to have a delete command in there to remove the them so the list could be rebuilt? If not I think it would just add additional rows.

    Scenario:

    Select Samsung Galaxy SIII

    3 rows added to the table

    Change selection to Apple iPhone

    2 more rows added to the table.

    Can you tell me how to use qrules to setup the delete command to delete the rows that were added initially? I already have the rules in place to set the 4 color fields to blank.


Page 1 of 2 (28 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.