Storing SharePoint Group in Global Variables


Badge +4

SP 2013

Nintex 2013

 

I have a Condition that checks to see if the item is for Company A or Company B.  If Company A, the global variable CFO is set to Person; if Company B, CFO is set to Group.  Both names resolve when 'Check Names' is clicked.

 

When the workflow runs, it errors "User Not Found".  The comment displays the following:  Set 58;#eCARCFO_Test as CFO.

 

I am new to both SharePoint and Nintex.  While I am acutely aware that I can just create two different Flexi Tasks (one for Company A and one for Company B), it seems like I am replicating unnecessarily when the only difference is the person/group to whom the task will be assigned.

 

This must be a fairly simple resolution to someone more experienced than I.


10 replies

Userlevel 5
Badge +12

How are you setting the variables and what is their source?  It seems maybe you are pulling from a List Lookup because I see the ID of the item attached in front of the value - 58;#eCARCFO_Test.   You could probably parse this out or try to obtain the value a different way, but I'd need to know more in order to off a suggestion as to how to pull this off.  The other question is: are these values dynamic - meaning is there more than one group or person that you must choose from, or are they constant for their respective types (person or group)?

Thanks

Badge +4

Hi Leah,

Can you please try to print variable value into "Log to History List" action before you use into Flexi Task. It will be helpful to know the actual value to see what is it trying to resolve?

Thanks.

Shirin

Badge +4

Thank you for your reply.

I will try the "Log to History List" action.  What is the difference in using this action instead of setting a message to log under the Common section?

I have the message to log on completion printing the value that is getting set, which is how I was able to see the 58;#eCARCFO_Test.  The name of the group I am setting the variable to is eCARCFO_Test.

Badge +4

Thank you for your reply.

I created a Workflow Variable named CFO, type Person or Group, with a default name set to someone whose name was selected from the People Picker.  Show on start form is not checked.

eCARCFO_Test is a Group that I created on the site with 2 names in it that I also selected from the People Picker.  The value of the names in the group are constant.

Using the Set Variable action, I would like to set CFO dynamically depending on whether or not the item is a test item for Company A or Company B.  If it's Company B, CFO is the group, if not, it is the person.

Userlevel 5
Badge +12

Is this a Site Workflow with a  Start Form?  Or is it a List based workflow?

Thanks

Badge +4

Thank you for your reply.

It is a list workflow.

Userlevel 5
Badge +12

The solution to this will be pretty straight forward, I just need to understand the process a bit more.

For example:   Since this is a list based workflow, you should create a column of type Person or Group so that you can store the value selected from the people picker into it.   The people picker control will then show up under the "List Columns" tab on the form designer from which you can drag and drop it onto the form designer.  This will automatically connect it to column you created and will store either the Person or Group that your form user selects when filling out the form.

If it is true that you are using a single people picker control to set the value of either this person or group, then you won't have to use Set Variable action in the workflow.  You can access this value instead from using "Item Properties" and it will contain whatever value was selected from the form.

Does this help?   If not, please post a picture of your form as well as your workflow so I can give you a more specific answer.

Thanks

Badge +4

For anyone seeing this thread, Troy's solution of storing it in a Single Line of Text variable worked for me too. Keep in mind that the Nintex Workflow "Person or Group" variable type may only work if the person or group exists in AD. If the group only exists as a SharePoint group, that's where you may run into trouble if using the Person or Group variable type. Use the text variable type instead and insert the plain text string name of the SharePoint Group. This was the case for me.

Userlevel 5
Badge +14

Allan Nevala any details why do you think people or group variable shouldn't work with sharepoint group?

I use it that way regularly without any problems.

Badge +4

Marian, it probably depends on context. If the Person variable isn't working as expected, then try just using a Text variable type. I've recently used the Person variable type successfully with assigning tasks to individuals and groups.

Reply