Blog Archives
Workaround person or group field one value problem Using Nintex Workflow 2010
So I had this problem the other day at work and wanted to share it along with the way I solved it.
First of all lets talk about how things look like:
When you have a field in SharePoint of type “person or group” that takes already defined users on the active directory of the system, you can manipulate weather this field takes one value or multiple values by the field properties page. when you insert multiple values they will be automatically separated by a semicolon as the following:
User1; User2; User3….
the problem is weather this filed has one user or 10, system will consider whatever there is as one value! you can make sure of that by putting the field value in a variable for instance.
So what if I needed to check every user of those for a specific reason ?! here is what was my case:
Problem Case:
The scenario was that a user enters many users that are responsible for a specific task when creating it, and a workflow works on item creation should check if one of those users is on a vacation or not, if they are, they should be replaced by their replacement that are already defined in another list in the site called employees.
Solution:
I was lucky to be using Nintex for this customer, I’m sure same solution is doable on Visual Studio but I’m not sure if it is doable if you are creating your workflow over SharePoint designer.
So to me the solution was using the very traditional way: get the filed of users as a string, split it, put the splits in a collection and loop over them to check your condition, then get them back as a string again.
For testing purposes, I’m using a 30 days trial online SharePoint site from Nintex Company, as you have to ask for users, I’m ganna replace one user statically within the workflow, you can make it as dynamic as you want based on your requirements.
So lets see:
1- What we have:
- A Custom List named “Assigned Tasks” having 2 added columns: Assigned Users and Result Users
User Enters the assigned users in the field no matter how many they are and and you can see users after changes done on them on the field the “users after replacement”
“you can put result in the same field but this is to show the difference”
- List Workflow named “replace vacation Users:” that works on creation and on edit.
2- Create all the Workflow needed variables as follows:
Variable name | Type | Show on start form |
Users as text | Single Line of Text | No |
Users as Collection | Collection | No |
Temp User | Single Line of Text | No |
Result Users Text | Single Line of Text | No |
Replacement | Single Line of Text | No |
Result Users | People or group | No |
3- Now moving to build some workflow actions:
– put the value of the field “Assigned users” that end user entered in the variable “Users as Text” using the action “set field value”.
Now we have a string, we will split it based on the semicolon between users “;”, use the action of “regular expression” with the option split as follows:
use the pattern “;#” to split the users coz that’s how SharePoint read them from active directory, save result in “Users Collection”
– Now add a “ for each” action to loop on all the collection, every loop needs a temp variable for the user that will be looped on, use the “temp user” variable for that as follows:”
– now add your wanted condition and apply it on the temp user “remember it’s a string now”
– Now if the condition applies, replace the value of “temp user” with the new value that you desire, in my case was the replacement name.
now lets build the all users string back: first add the semicolon back to the temp user using the “build string” action, save the new string (user1; ) in same variable “temp user” as follows:
– add this user to the rest of the users string (weather it is replaced or not it’s the same), doing this step in each loop will guarantee that the result users will be in same order. use the “build string again and add the temp user to the variable “Result Users Text” as follows:
store the result in the same “Result Users Text”
– Now, as “people or group” field does not accept text directly, we are ganna set the “Result Users Text” in a variable of type “people or group” then we will put this variable in the field of same type:
– And Last but not least, put the variable value back to the field “Users After Replacement”
Note: if your workflow showed and error you can hunt the errors easier by creating a field of type text, put the result in it and watch what it will be, as one more semicolon might ruin adding the string to the people field.
– Before saving and publishing your workflow, make sure it works on creation via workflow settings.
So lets see it in action:
manager starts a new task, enter the name and assigned users as the following (manager does not have to check if a user is on vacation or not).
In my case the accountant is on a vacation and the replacement is the field Engineer (as much as illogical that is!) anyway its only for testing purposes, after adding the new Item it will show up in list as follows:
and that’s it! user will be changed when workflow is completed.
Just for the record, Nintex is not paying me for this Hope that helped. Enjoy
SharePoint 2010 For Students – Baby Steps (3), Arabic Version
حلقة خدمات الشيربوينت
اذا أثارت موضوعاتنا السابقة اهتمامك فيما يخص الشيربوينت، من الممكن أن تكون قد قمت ببحث عن ماهية هذا المنتج، وباعتقادي أيضاً أن هذه الصورة قد مرت على ناظرك في مكان ما، وتساءلت عن ما تعنيه أو أهميتها، هذا ما سنتحدث عنه في هذه التدوينة.
هذه الصورة تمثل الخدمات المقدمة من منتج الشيربوينت، أو، بعبارة أخرى، ما يمكن أن تقدمه لك كمستخدم.
لنبدأ بـ المواقع : من المعروف أن الشيربوينت يقدم لك خدمة بناء المواقع، قد تقول: "أين الجديد!"، الأمر لا يتوقف عند هذا الحد، ليس عليك أن تكون مبرمجاً محترفاً لتقوم بانشاء موقع باستخدام الشيربوينت، كل ما عليك فعله هو اختيار النموذج المناسب لك، والقيام بعدة نقرات بسيطة بواسطة الفأرة، لتجد أن الموقع أصبح جاهزاً.
مواقع الشيربوينت تختلف عن المواقع الأخرى بأنها تسمح للمستخدم بالتفاعل بدلاً من القراءة وحدها، أي انه يمكن لأي مستخدم تغيير محتواها، اضافة الصور، وأشياء كثيرة أخرى يمكننا التحدث عنها لاحقاً.
أما بالنسبة لـ المجتمعات، تعطيك الشيربوينت أدوات تمكنك من بناء بيئة تفاعلية تتواصل من خلالها مع الآخرين، وبناء مواقع مخصصة لهذه الأهداف، كمواقع لفرق العمل والشركات، كما يمكن تحرير نفس المستند من عدة مستخدمين كما ذكر سابقاً
هذا المنتج الضخم يوفر لك الإمكانية لحفظ المحتويات بدلاً من حفظها على جهازك، الصور والمستندات وكل ما يخصك، يمكنك بناء مكتبات خاصة بك وحفظها تحت الفئات التي تناسبك، ثم تخصيص مستوى الخصوصية الخاص بك ومشاركتها مع من تختار من المستخدمين الآخرين.
عندما تكثر المحتويات، هذا يعني أنك بحاجة لمحرك بحث لأيجاد ما يعنيك بأسرع وقت ممكن، لم يغفل مطورو الشيربوينت هذه الخاصية أيضاً، حيث قامو بتطوير محرك بحث عملاق له من الخصائص ما يمكنك من تحديد نوع البحث وتخصيصه الى أبعد الحدود، والتوسع الى البحث داخل المستندات أو بخصائصها (كتاريخ الإنشاء أو اسم المؤلف) وحتى البحث عن أشخاص أيضاً.
مع الشيربوينت، لن تتعامل مع المعلومات بالطريقة التقليدية بعد اليوم، فهي تمكنك من ترتيب المعلومات بطريقة متقدمة ومحترفة وغير يدوية، كالرسوم البيانية باستخدام برنامج الفيزيو أو جداول البيانات أو نظم الأعمال الذكية، يمكنك بعدها من القيام بأتخاذ القرارات بناء على نتائج هذه المعلومات. لذلك من الممكن اعتبار هذا المنتج منتجاً تجارياً لأصحاب الأعمال بامتياز.
هذا باختصارٍ شديد ما يمكن أن تقدمه لك الشيربوينت مع العلم أن كل مجالِ من هذه المجالات يحتاج أشهراً للدراسة والتعمق، وله المختصين والمحترفين به، لذلك يمكنك اختيار المجال الأنسب لك واحترافه.
يمكن لهذا الرابط توضيح الموضوع بشكل أكبر : حلقة خدمات الشيربوينت
أتمنى أن تكون هذه التدوينة قد ساهمت في معرفة ماهية هذا المنتج بشكل أفضل للقارئ، كما أتمنى أن تعم الاستفادة في التدوينات القادمة أيضاً
يمكنك أيضاً قراءة هذه التدوينة باللغة الانجليزية : تعلم الشيربوينت للمبتدئين الحلقة الثالثة
كما يمكنك قراءة
SharePoint 2010 For Students – Baby Steps (2)
“WHAT THE HELL IS SHAREPOINT ?!”
Ever since I started learning SharePoint, People have been asking me that question, People who have spent years in IT sector and even people who have attended sessions about SharePoint !
so,, my guess would be that everyone is kinda have a hint about what SharePoint is, but they are looking for that one simple sentence that says it all, the one making them feel like they rapped their hand around it and say : “AAH,, So that’s What SharePoint is all about !!”.
well, I don’t wanna play the bad guy here , but .. there is no such sentence simply because SharePoint is not one simple thing, you don’t just go and buy a SharePoint…
so what is it !! “It’s a group of Products, a platform , a collection of different technologies, all gathered to help build collaboration solutions.
With SharePoint you can build sites within Minutes ,, with Simple Clicks,, it is designed with built in templates that makes anybody (even not an IT person) Use it,, “
The thing I love about SharePoint is it’s capabilities, the infinite options that SharePoint can offer to its Users , with it you can build your own Intranet, extranet, private social network, professional network, search engine, and public-facing website.
you can even create your own blog using SharePoint, wikies, or document sharing interfaces and Teams sites ,, Can you imagine editing the same word document with a team colleague at the same time ?!!
every one of these is a huge world by itself, as far as I know, no one has the knowledge of all about SharePoint, but once you have an Idea about what it is you can choose what tools and technologies can help build your solution, and stop worrying about learning and having fun exploring every new about it.
SharePoint and Office are close Friends, so if you don’t have troubles dealing with office, you wont find hard time dealing with SharePoint as an end user.
I think I have to mention that SharePoint is a server product, you don’t get it and install it on your PC or Laptop ,, it’s installed on backend systems and shared along a network,
So,, if I have got your attention and you wanna learn more about it, SharePoint MVP Mohamed Saleh Has started a great series of posts on his Blog called baby steps , pointed to beginners and students who wanna learn about it ,,,
And I have the honor of joining him in this series by cross blogging posts, which means this post is circle 2 in the series, you can find “SharePoint 2010 For Students – Baby Steps (1)” on his blog,,
more details are coming in next posts,,, the Two blogs will Connect with you all the way towards running the SharePoint road ,,, stay tuned