Microsoft Collaboration, CTO viewpoint, and New York

The blog for Office 365, Power Apps, Flow, SharePoint, cloud, ….. plus a little NYC

You are currently browsing the SPD category.

Double booking with the calendar

This entry explains one way to deal with double booking. The explained SharePoint Designer procedure is not bullet proof, but by extending it, it could easily be made to be.

This procedure will check to see if the conference book is already booked and if it is, an email is sent to the creator of the list item stating that the conference room is booked.

Steps:

  1. Set up a workflow so that each time a calendar item is saved the workflow runs.
  2. Create a condition to check the start date of the current item <Start Time> is greater than a start time of other items in the list.

Note:
Start Time contains Date and time

  1. Create a sub condition to check the start date of the current item <Start Time> is less than a start time of other items in the list.

Now we have identified if the current saved item’s <Start Time>, is in between other items. AKA a double booking.

  1. An email should be sent if there is a double booking. What should be done is a further condition to only send the email if the item is created. This can be done by comparing the created and modified dates.

The whole step should look something like this:

One point to be made with adding in a double booking check process. Be careful of what you ask for. If you add a hard and fast rule, it will have to work in every time. Often (particularly when humans are involved) this is not possible. E.g: The owner of the firm books the conference room and out ranks all over booking. Be pragmatic.

Extracting email from Active Directory

While building a workflow in SharePoint Designer I came across the problem of sending an email from a Person field with multiple values.

I discovered that the value coming from AD was:

357;#Peter.Ward@ABC.com; 357;#Paul.Smith@ABC.com

To get round the problem of the email address containing numbers and #. Build a string in SPD and have the AD lookup values returned as:

Custom actions SharePoint Designer

A nice feature in SP 2010 is the ability to add custom actions to a list drop down menu.

From this:

To this

Notice that graphics can also be added:   The custom actions, can include:  kicking off workflows, going to a URL, or creating a new item…..even in another list.

This is a huge benefit for the user experience, as there is less clicks (yeah!!!!)  and the user can select multiple workflows, from options from just glancing at an item in a list…..

This is done through SharePoint Designer:

Steps:

1. On the Custom Actions tab, click Custom Action in the New group, and then click Display Form Ribbon.
2. In the Name box type Kick Off workflow. In the Navigate to form list, select
the workflow for the list.
3. In the Button Image URL (16×16) box, click Browse, and then select the image you want to use, such as workflow.gif.  In the Button Image Click OK.

Simple


Custom Actions on a list item

Lookup field. Problems.

I discovered this issue the other day.

Scenario:  Lookup field intending to bring back the Title field of a Web part page in another list.

There’s a problem.

When you create a web part page in a library, the name of the web is what you define it as, not the title.  The Lookup field type, can’t look up the name…..Only other fields like the title.

How do you get round this?

Create a SPD workflow to populate the title field, when the field is modified.

Tabbed web parts

If you ever want to tab web parts on a page so they can be displayed horizontally, rather than vertically, use this text in designer:

 orientation=”Horizontal”

 eg:

 <WebPartPages:SPWebPartManager runat=”server”>
</WebPartPages:SPWebPartManager>
<WebPartPages:WebPartZone runat=”server” orientation=”Horizontal” title=”Zone 1″>

<WebPartPages:ImageWebPart runat=”server” VerticalAlignment=”Middle” AllowEdit=”True” AllowConnect=”True” ConnectionID=”00000000-0000-0000-0000-000000000000″ Title=”Image Viewer” IsIncluded=”True” Dir=”Default” BackgroundColor=”transparent” IsVisible=”True” CatalogIconImageUrl=”/_layouts/images/msimagel.gif” AlternativeText=”” AllowMinimize=”True” ExportControlledProperties=”True” ZoneID=”” HorizontalAlignment=”Center” ImageLink=”” ExportMode=”All” AllowHide=”True” SuppressWebPartChrome=”False” DetailLink=”” HelpLink=”” FrameState=”Normal” MissingAssembly=”Cannot import this Web Part.” PartImageSmall=”” AllowRemove=”True” HelpMode=”Modeless” FrameType=”Default” AllowZoneChange=”True” PartOrder=”2″ Description=”Displays a specified image.” PartImageLarge=”/_layouts/images/msimagel.gif” IsIncludedFilter=”” __MarkupType=”vsattributemarkup” __WebPartId=”{ef59e74a-d586-4886-bb4e-839781f2adff}” WebPart=”true” Height=”” Width=””></WebPartPages:ImageWebPart>

<WebPartPages:ContentEditorWebPart webpart=”true” runat=”server” __WebPartId=”{5C6D12CE-5695-48F8-8E70-BF27D2E989D2}”><WebPart xmlns=”http://schemas.microsoft.com/WebPart/v2″>

                <Title>Content Editor</Title>

                <Description>Allows authors to enter rich text content.</Description>

                <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>

<PartOrder>4</PartOrder>

<ID>g_5c6d12ce_5695_48f8_8e70_bf27d2e989d2</ID>

</WebPart></WebPartPages:ContentEditorWebPart></WebPartPages:WebPartZone>

What is REST?

The REST (Representational State Transfer) API for SharePoint is designed to give developers an alternative method to access the data that stored inside of SharePoint. It’s goal is to make SharePoint more ‘mash-able’.

Just as SharePoint can act as a SOAP service provider and client, so it can act as a REST service provider and client. This lets you use SharePoint Designer to create solutions that

consume XML data from REST services, including XML data retrieved from SharePoint REST interfaces. The number of SharePoint REST interfaces is small compared to the number of

SharePoint SOAP service interfaces. The two SharePoint 2010 REST interfaces are

-ListData.svc Provides access to list and library data.
-ExcelRest.aspx :   Allows for easy discovery of and access to data and objects within a spreadsheet.   (Enterprise only)

Ever wanted to stop conflicts on a calendar?

This did take some time to think about, but it’s pretty easy.

1. Kick off a workflow when the item is created/modified

2. Add a delay in the workflow. This is because if the look up into the list is done too soon, the item saved sometimes, can not be found.

3. Perform a look up on the Item id and compare.

SharePoint Designer add ins for workflows

These are great additions for workflow activities from the codeplex site.

Send Email with HTTP File attachment – Allows sending emails with attachments retrieved using a web request
Send Email with List Item attachments – Allows sending list item attachments as files attached to an email
Start Another Workflow – Starts another workflow associated with a list item
Grant Permission on Item – Allows granting of specified permission level on a spicified item
Delete List Item Permission Assigment – Allows deleting of specified permission level assigment for a given user
Reset List Permissions Inheritance – removes any unique permissions assigned to an item by inheriting list permissions
Is User a member of a SharePoint group – Checks if a given user is part of given sharepoint group
Is Role assigned to User – Checks if a user role is already assigned on the current list item
Lookup user info – allows to lookup properties in site’s user information list for a given login
NEW! Copy List Item Extended Activity – Allows copying/moving list items and files cross site.
NEW! Send Email Extended – Enhaced version of the OOTB activity. Allows you to specify the sender. Also does not break links in body.

For the true power of SharePoint Designer, click here

Workflow migrate code. Quite nice for dev to production activity.