Blog Archives

Workaround person or group field one value problem Using Nintex Workflow 2010

nintex2010

 

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….

10

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”.

 2

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:

3

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:”

4

– now add your wanted condition and apply it on the temp user “remember it’s a string now”

5

– 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:

6

– 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:

7

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:

7

– And Last but not least, put the variable value back to the field “Users After Replacement”

8

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).

1

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:

10

and that’s it! user will be changed when workflow is completed.

Just for the record, Nintex is not paying me for this Smile with tongue out Hope that helped. Enjoy Smile

SharePoint 2010 For Students–Baby Steps (7)

 

SharePoint Architecture, Lets talk SharePoint Language

This blog’s goal (other than explaining SharePoint Architecture) is to simplify some variables and terms in SharePoint, that would be used in next posts, which means; from now on, we are going to talk SharePoint language;

Note: definition of terms is are not referenced to anybody or any site, they are written in my own words, it is not professional and maybe not same as Microsoft definition but my only goal here is to deliver the idea, if that was done it would be enough for me Smile

From My perspective and to make it seem easier I am going to classify the

hierarchal Levels into two categories, high level one and low level one

The high level one (which can be accessed only by administrator and includes some setting not necessarily SharePoint core ones, such as database, Active Directory, Networks and so on), this category level includes:

Image above explains how are these pieces related to each other to form a full system: 

Farm: You can consider it as a container for all servers you will be using including the network connecting them –how to set Servers in a farm and on what bases  is the Administrator’s job – which is a high level and won’t be explained in this post.

Server: I think I don’t need to explain what a server is, the difference in SharePoint that, the admin will decide which server will have what, as mentioned before, you need x64 hardware, at least Windows Server 2008 R2, you can find all other Prerequisites on Mohamed’s Blog here

Most beginners will deal with a term called “a single server farm” which means that all the system will be installed on one server, meaning if you installed SharePoint on your Laptop, you can call it a single server farm

Content Database: Is the Database keeping all the data of the contents of Site Collections and everything in them – site collection is defined later in the post –

Web Application: Although having a URL, application is a virtual term, which means you cannot see an application once you create it, application takes a port, security type and other parameters will be explained later.

“Once you install SharePoint, two applications will be automatically created, Central administration one (which admins will be able to handle all other applications, services, functionalities and features from) and a regular web application with a site collection to start from”

The other Terms when we go down the chart to smaller definitions will be considered in the low level category, they are:

 Site Collection: You can look at a site collection as a Site, but as a unique root site, that is a containerof other site or sites, so you can use all of site’s functionalities on a site collection

Site: A site is a unit of independent data, users and permissions, different sites can also be different in themes, templates and so on, each site can also be a parent of other site/sites and these sites can hold other sub-sites and so on. they also can contain lists, document libraries and pages, those will be defined next.

Document Library: Can be Considered as a container of documents (word, PowerPoint. Excel. PDF, etc.) But, it does not stop to that limit, you can add special parameters to define each document of those in order to help in classifying them and search for them, those parameters are called (metadata)

An Example of metadata for document would be like (name, author, date of creation, and any other field you would like to add)

List: Container of data that is structured in a customizable way according to need.

Lists are the most important storage units in SharePoint, most of Sites’ data is stored in them, and to be more specific, Document libraries are special type of lists. and because of their importance, we are going to define them in a little bit more detailed way:

Look at a list like a table of columns and rows, columns are called fields, as in excel sheets or any type of database, each field will have a type (text, number, date, etc.)

So when you insert data to those fields you will have records (horizontal rows in table), each record is called an item that have its special parameters.

Each Item has the ability to attach a document to it in an optional way.

So what is the difference between a document library and a list ?

Well, if you are lucky enough to use them you will notice that when adding a new Item to a document library, it is essential to start a new document (or upload one to the system) then you will see a form to add the metadata of that document. in case of adding a new Item to a list, you will add the metadata, and that would be enough, then you have the option to add (attach) a document or not.

So it means that a list can contain only data while a document library has to contain documents.

Other terms you will frequently hear:

View: A way to show data of a list or a library, or we can describe it as a way of reporting for data based on some conditions and filtering criteria, like: which user is viewing data, subject,date etc..

Web Parts: part of the page that provides a specific functionality with user interface and can be customized according to need, people knows them as widgets on famous sites. like a part showing today’s weather, or a part on the side to show your contact list and so on.

Page: page is where you can see It all, views of lists, Web Parts, texts, pictures, lets just describe it as the interface of data for the end user.

all pages of site are stored in a special Document Library called Pages Library, where it has all features of the Document Library Except that instead of Documents you will find site pages

Workflow: a set of actions on an item that can be predefined by creator an
d used to do changes as needed when needed. like action of sending email to admin when a user adds a new Item to list, this will happen each time an item is added and it is predefined by the admin to do so.

So lets put it all together:

a Farm has a set of servers (one or more)

A server that has SharePoint Installed on have one or more Web applications

a Web Application have one or more site collections

a site collection has one or more Sites

a Site has:

  • Sub-Site/Sites
  • Document libraries
  • Lists
  • Pages
  • Views of Lists and Document Libraries

Note: What you can view,create, edit, delete, etc. of those parts depends on your Permissions that were given to you by the administrator.

I know, I listed a lot of new Information at the same time, you will be able to get them in a better way when I start introduce them to you face to face in the next post and the coming posts Smile and surely nothing new can be fully understood without live examples,  so stay tuned.

you can check out all the previous posts for SharePoint Baby Steps here

SharePoint 2010 For Students – Baby Steps (3), Arabic Version

 

image

حلقة خدمات الشيربوينت

 

اذا أثارت موضوعاتنا السابقة اهتمامك فيما يخص الشيربوينت، من الممكن أن تكون قد قمت ببحث عن ماهية هذا المنتج، وباعتقادي أيضاً أن هذه الصورة قد مرت على ناظرك في مكان ما، وتساءلت عن ما تعنيه أو أهميتها، هذا ما سنتحدث عنه في هذه التدوينة.

هذه الصورة تمثل الخدمات المقدمة من منتج الشيربوينت، أو، بعبارة أخرى، ما يمكن أن تقدمه لك كمستخدم.

لنبدأ بـ المواقع : من المعروف أن الشيربوينت يقدم لك خدمة بناء المواقع، قد تقول: "أين الجديد!"، الأمر لا يتوقف عند هذا الحد، ليس عليك أن تكون مبرمجاً محترفاً لتقوم بانشاء موقع باستخدام الشيربوينت، كل ما عليك فعله هو اختيار النموذج المناسب لك، والقيام بعدة نقرات بسيطة بواسطة الفأرة، لتجد أن الموقع أصبح جاهزاً.

مواقع الشيربوينت تختلف عن المواقع الأخرى بأنها تسمح للمستخدم بالتفاعل بدلاً من القراءة وحدها، أي انه يمكن لأي مستخدم  تغيير محتواها، اضافة الصور، وأشياء كثيرة أخرى يمكننا التحدث عنها لاحقاً.

أما بالنسبة لـ المجتمعات، تعطيك الشيربوينت أدوات تمكنك من بناء بيئة تفاعلية تتواصل من خلالها مع الآخرين، وبناء مواقع مخصصة لهذه الأهداف، كمواقع لفرق العمل والشركات، كما يمكن تحرير نفس المستند من عدة مستخدمين كما ذكر سابقاً

هذا المنتج الضخم يوفر لك الإمكانية لحفظ المحتويات بدلاً من حفظها على جهازك، الصور والمستندات وكل ما يخصك، يمكنك بناء مكتبات خاصة بك وحفظها تحت الفئات التي تناسبك، ثم تخصيص مستوى الخصوصية الخاص بك ومشاركتها مع من تختار من المستخدمين الآخرين.

عندما تكثر المحتويات، هذا يعني أنك بحاجة لمحرك بحث لأيجاد ما يعنيك بأسرع وقت ممكن، لم يغفل مطورو الشيربوينت هذه الخاصية أيضاً، حيث قامو بتطوير محرك بحث عملاق له من الخصائص ما يمكنك من تحديد نوع البحث وتخصيصه الى أبعد الحدود، والتوسع الى البحث داخل المستندات أو بخصائصها (كتاريخ الإنشاء أو اسم المؤلف) وحتى البحث عن أشخاص أيضاً.

مع الشيربوينت، لن تتعامل مع المعلومات بالطريقة التقليدية بعد اليوم، فهي تمكنك من ترتيب المعلومات بطريقة متقدمة ومحترفة وغير يدوية، كالرسوم البيانية باستخدام برنامج الفيزيو أو جداول البيانات أو نظم الأعمال الذكية، يمكنك بعدها من القيام بأتخاذ القرارات بناء على نتائج هذه المعلومات. لذلك من الممكن اعتبار هذا المنتج منتجاً تجارياً لأصحاب الأعمال بامتياز.

هذا باختصارٍ شديد ما يمكن أن تقدمه لك الشيربوينت مع العلم أن كل مجالِ من هذه المجالات يحتاج أشهراً للدراسة والتعمق، وله المختصين والمحترفين به، لذلك يمكنك اختيار المجال الأنسب لك واحترافه.

يمكن لهذا الرابط توضيح الموضوع بشكل أكبر : حلقة خدمات الشيربوينت 

أتمنى أن تكون هذه التدوينة قد ساهمت في معرفة ماهية هذا المنتج بشكل أفضل للقارئ، كما أتمنى أن تعم الاستفادة في التدوينات القادمة أيضاً

يمكنك أيضاً قراءة هذه التدوينة باللغة الانجليزية : تعلم الشيربوينت للمبتدئين الحلقة الثالثة

كما يمكنك قراءة

 تعلم الشيربوينت للمبتدئين – الحلقة الثانية

تعلم الشيربوينت للمبتدئين – الحلقة الأولى

SharePoint 2010 For Students – Baby Steps (2)

 

SharePointInBlack

“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 Smile 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,,

Sharepoint-2010 (4)

more details are coming in next posts,,, the Two blogs will Connect with you all the way towards running the SharePoint road ,,, stay tuned Smile