You should log the variable that you're getting before your "send notification" action and disable the email action for your testing until you are able to see what value you're getting. Can you open up your "set variable" action? I'm guessing this is where you get the employee's manager? In your "For Each" are you outputting some kind of index or ID?
here is the info. Is there a way I can just refer to the user profile and do everything from there?
how do I relate it to the list I am currently trying to filter on? Also, can I add the variable as the User?
So, I would do the query and retrieve the ID of all the items that match your date case. Then, for each ID, output the ID (to use to iterate through). Inside your for each, you need a query user profile. To get the email address of the user you want to run the query on, you should use the "Advanced Options" and pick
Source: yourListName
Field: yourUserField
when: ID
equals: workflow variable: variable you've stored the individual ID on
Your config may look slightly different as I'm in O365 but just give a holler if you can't get it sorted.
Ok, looking at the documentation here: http://help.nintex.com/en-US/nintex2013/help/#Workflow/RootCategory/Actions/Nintex.Workflow.QueryUserProfile.htm%3FTocPa…
Yours looks different in On Prem. But you can do the same thing in your action now that you have the framework, I'm pretty sure .Again, let me know if this isn't clear enough.
Thank you. I've changed the query list to grab the ID and it populates in the queriedItemCollection:
. in the for each, target collection = queriedItemCollection (variable) and Store results in queriedItem (variable). I then have the query user profile:
is this correct?
It should be, give it a whirl, don't send the emails, just log the varManager in the workflow history and see if you're getting your expected values
ok I will try now. based on my query user profile info, can I only send the notification if the user is active? if so, would I do a run if?
Thank you so much for your help!!
Is it a possibility that the users in this list could be inactive? I don't think their manager(s) could be. Honestly, I'm not as familiar with On Prem as I'm exclusively in 365, but perhaps , , or someone else could chime in on the best way to do this with your specific action configurations. It looks like, to me at least, that you're picking from a list of attributes you can retrieve on a user. Manager was the one you originally wanted so you would know who to send the email too, so I think you would only honestly need that one (assuming all users in this list will be active). I would just use that to set your managerVar and leave everything else how you already had it configured from the start with your notification and such.
I am getting the following error: "Error querying user profile. Object reference not set to an instance of an object." at the user profile.
According to the documentation for the action, you need to make sure you've configured your input for the query to be the login name:
Your varEmployeeName should be the login name, not the display name, is that the case for your current configuration?
Have a look at where I am sure mentions a check to see if a user is a valid user - this may help.
Hello D M -
Are each of your variables collection variables?
I think you are on the right track here with Courtney Vargo's help!
Here is how I would approach this (hopefully without confusing you )
- Query List - get a list of all data points you need based on dhire_date] = etoday] - 90
- Each of these should be collection variables so we can loop through them later
- For Each loop - loop through your collection (doesn't matter which one, I usually use Title] or ]Name])
- Within the For Each loop
- Run If oActive] = "Yes"
- Within the Run If
- Collection action - get all other pieces required (name, manager, etc)
- Send Notification - at this point you should be able to send your notification to the specific manager for the active employee
- end Run If
- end For Each loop
I would also confirm that the User Profile services are returning accurate information. I have seen this used and later on it was discovered that there is missing data or it was not being updated properly.
Hope this helps!
it is the display name. I will update and reach out with the outcome. Thank you All!
so I've added the collection to get the manager. the Target collection works (ManagerNameCollection) works (I see both managers that would receive the email) however, the varManager is blank.
in the history I pulled the varManager, varManagerName and the ManagerNameCollection. Only the manager name collection has the two individuals and is not null.
What does your For Each action look like? And where are you setting/getting your index variable?
The above is the for each and here is the query list (which comes before the for each)
Are you logging your index to make sure you're trying to grab the right manager from the collection?
I read somewhere that I needed to do that. if it's not necessary I will not
What are your variable types setup as?
My guess is that they are mismatched and it is trying to add it to the variable (varManager) and cannot. Then, when you are going to query the varManager, since it is empty, varManagerName is coming back empty as well.
I see. so what should I do to get the correct manager? Sorry for all the questions. I'm stuck on this after trying so many different things.
D M -
No worries! You are in the right place to get help, trust me
I would add in some Log in history list actions into your workflow to confirm that the data is what you expect it to be and something is coming through. I know some of our fields in the user profile are blank and causes issues with workflows.
I made a quick workflow that queried a list with two items. I grabbed the hCreated By] column in my collection (both are me ) and I then looped through the collection to get the specific user into my variable. I then used that variable to query the user profile. I added logging after each step so that I can see what is in each variable for each loop through:
Here is a quick sample workflow of what I did:
You said you already did this, so I am wondering if perhaps the ManagerNameCollection data is not in the proper format to be used in your variables. Are you getting data in a format like domain/username ?
I am not trying to use the user profile I am trying to instead to the collection action. I do get both of the manager emails in the collection. I am not sure what to do after that (so the manager receives the correct email for their employee).
So if you're not using the User Profile query, where are you getting the Manager info from? Is that a column in your list that is already populated?
correct. it is a single line of text with the manager name. The issue I am having is that the first manager receives emails for both the employees. Instead of the second manager receiving the email for his employee.