Category Archives: InfoPath

How to hide a group of fields in a SharePoint list using InfoPath 2010


You may also be interested in: fpweb.net


 

Editor’s note: Follow contributor Abhisarika Singh @Abhisarika.

I’ve found a really easy way to make collapsible/hidden group of fields in a SharePoint list form using InfoPath 2010. The important thing is we can apply this in an existing list and can modify the form. Below are the steps we can use to make a hidden group of fields:

  1. Open the list in InfoPath 2010 and select Section from the menu bar:
  2.  2013-10-08-HideGroupFields-01.png

  3. Select the section and insert a new table in that section.
  4. 2013-10-08-HideGroupFields-02.png

  5. Then insert the fields in the table. As I mentioned, my list is already present and I like to hide the fields based on the conditions. So I just drag the fields from the field column to table rows and show them in a table. This table must be inside the section.
  6. 2013-10-08-HideGroupFields-03.png

    2013-10-08-HideGroupFields-04.png

  7. Once we complete the table with the fields we would like to hide, based on our condition, we go to “section”. This is the important thing we need to do for hiding or showing our fields based on our condition.
  8. Select the “section” and go to “Manage Rule”. Insert a new rule having the condition as per our requirement. In this example I’ve put a condition that if field “Request type= Deletion” then this employee’s details table will be hidden through the “formatting” rule or not displayed.

    2013-10-08-HideGroupFields-05.png

    Then set the condition I mentioned above:

    2013-10-08-HideGroupFields-06.png

    Go to formatting rule and select “hide this control”:

    2013-10-08-HideGroupFields-07.png

That’s it. Now you can see your form as per the condition you set.

2013-10-08-HideGroupFields-08.png

SharePoint and the Perils of InfoPath


You may also be interested in: Mobilize SharePoint Webinar by Sitefinity


 

Editor’s note: Contributor Ellen van Aken is an experienced intranet adoption manager. Follow her @EllenvanAken

Our Business Solutions team has not used InfoPath very often. It is really a very cool tool, and I love its transparency, but people often experienced an access denied or other annoying error message that prevented them from working with it. It may have had to do with our customization.

Next to that, some forms can be very complex, especially when you need different views for different people, of if they take data from other lists or even from other systems.

We have had to refuse support when a customer support form broke down. It had tons of clever functionality built in: conditional notifications, different views and it imported the customer’s name from SAP when the SAP number was entered. The person who had created the form had left the company without any documentation on the setup, so it would have taken a specialist (which we did not have at that time) many hours to figure out how the form worked.

Identical icons.

But there is another danger in InfoPath forms, or rather in the libraries they live in, and especially in SP2003 and SP2007. Those libraries have identical icons…and I guess you can tell how this story will unfold. It’s tagged with “Bloopers”…but also with “Learnings”.2013-06-12-SharePointPerilsInfoPath-01.gif

My colleague-who-wanted-to-investigate-the-boundaries-of-Sharepoint (I mentioned him earlier) had a challenging project: creating a quiz in InfoPath format. We could not think of another way to do this 60-question quiz, which had an extensive score calculation built-in that resulted in your preferred Learning Style. The whole Quiz was a manual exercise, and our Learning & Development team could no longer calculate the score by hand because of resource restrictions They did not want to leave the scoring to the user, so we wanted to see if we could automate it.

All completed forms would be collected in the library, but everyone could only see their own form.

My colleague spent about 10 full days on this form, and after enthusiastic and extensive testing by both parties we could finally mark the project as completed.

A few weeks after sign-off we received an anguished call from the owner. Her intern, who was on a cleaning spree, had deleted the library because it contained no documents. Could we restore it?

Unfortunately we could not, since my colleague had not kept a copy. So he could do it all over again…

What have we learned?

These are the preventive measures we took from that day onwards:

  • We added the text “System List-Do not delete!” or similar text to the description field of every custom-configured or otherwise important list or library we created from that time on.
  • We saved a template of every library or list with complex configuration in the List Template Gallery of the site, and also in our own Team Site
  • At the moment of handover, we created a backup of every site that we configured (and sometimes also saved the template in our Team Site).

In SharePoint 2010 Microsoft has finally addressed this library icon issue. But if you are working with an older version, be careful!

2013-06-12-SharePointPerilsInfoPath-02.png

What SharePoint can learn from SurveyMonkey (and vice versa)


You may also be interested in: Free SharePoint Plugin for Outlook


 

Editor’s note: Contributor Ellen van Aken is an experienced intranet adoption manager. Follow her @EllenvanAken

I have always hated SurveyMonkey. Not that I knew it well, but out of principle: I try to help my colleagues work with SharePoint, and the more SharePoint they see, the faster they will get familiar with it. Using a survey on another platform is downright confusing.

But some time ago I looked at SurveyMonkey, to find out the reason for its popularity. The Basic (free) version will be the largest competitor for SharePoint in organizations, so I have limited my comparison to that version.

What is good about SurveyMonkey?

It is a very nice tool, if only because the larger font and sharper contrast are easier to read for me.

There are more options in terms of design (themes, images between the questions), they have a few different question types (a.o. ranking), you can draw from a reservoir of example surveys and “bias-free questions” and you can randomize the answer options.

That may not be a surprise, since SurveyMonkey is a “one trick pony”, focusing on surveys, while SharePoint is more of an “all-rounder”.

Which functionalities should be in SharePoint?

Still, there are some useful SurveyMonkey functionalities that I would expect in SharePoint:

  • SharePoint knows the date and time, so why does it not have a “cut-off date/time”, after which it is no longer possible to fill in the survey?
  • SharePoint can count, so why is there no option to stop responses when the number of replies exceeds a certain number? How useful that would be for registrations for events or trainings with a limited number of places!
  • Why can’t you add a description to the questions in SharePoint? You can do that in any list or library, so why not in a survey?

One point where SharePoint could make a big step forward is in the multiple-response questions. SurveyMonkey allows you to show the answers in columns, which need less vertical space.


Input for a multiple-choice question in SurveyMonkey

In SharePoint, answers are all in one column.


Input for multiple-choice question in SharePoint.

Now, let’s take a look at the way the results are shown. SurveyMonkey provides you with a nice, clear graphical overview.


Results of a multiple-choice question in SurveyMonkey

While SharePoint is a mess, so you always need to do a manual scoring afterwards.


Results of a multiple-choice question in SharePoint

Does anyone know if this has improved in SP2013? If not, would someone please forward this post to Microsoft so they know what to work on for SP2016.

In favour of SharePoint.

SharePoint also wins on a number of points:

  • You can use any number of questions and receive any number of responses. (Not that your audience will be too happy with too many questions). The free account of SurveyMonkey allows you up to 10 questions and 100 responses.
  • You can send respondents to a “Thank you” or “Next steps” page after completion, by configuring the link you send to your audience. (described in this post-scroll to 2f) SurveyMonkey offers that in a paid version only.
  • You don’t have to log in to make a survey or to see the results.
  • You can use a “lookup”(existing content in the site), currency and select “People and Groups” as answer options.
  • SurveyMonkey allows you to export to spreadsheet per question only. Exporting the complete survey needs the paid version.
  • SharePoint allows branching (the next question depends on the answer you gave to the previous question), while SurveyMonkey only provides that in the paid version.
  • Your survey has more context if it is in your own Team Site.
  • The data are stored in your own environment.

If you know other good arguments in favour of the SharePoint survey, please add them below!

What is the verdict?

I understand the attraction of SurveyMonkey. It is easy to use and it has more visual possibilities. (Now that comes as a shock) It also does the multiple-choice questions much better, and it has a ranking question type.

However, for the average in-company survey, SharePoint will do the trick. It will be one step forward in providing employees with their “daily dose of SharePoint”.

And in those cases where I have found that the SharePoint survey was too limited for a certain purpose, the free SurveyMonkey tool was not an option either.

Sometimes the demands of the business required a SharePoint list or an InfoPath form to collect data, or even an Excel file, because there were too many dependencies or people wanted to have too many different slice-and-dices. In those cases, the Basic version of SurveyMonkey provided no solace. We would have needed a paid version or an even more advanced tool.

Does this sound familiar? How do you handle surveys in your SharePoint environment?

How to Edit a List Form Using InfoPath Designer 2010


You may also be interested in: Documentation Toolkit for SharePoint


 

Editor’s note: Contributor Alexandru Dionisie is an Internet Professional and Technical Writer. Follow him @AlexDionisie

Usually what is default is not good, because it has an “ugly” look. This is why; data entry forms in SharePoint aren’t too attractive.

If we want to get rid of what is unattractive, we can apply different customizations. In SharePoint Online 2010 we can use InfoPath Designer to customize our forms.

How?

  • access a desired library/list/etc.;
  • from the List tab click on Customize Form;

Now, the form is opened in InfoPath Designer, and we can start to edit it.

Depending on how you want the form to look, you can:

  • add new fields;
  • rearrange fields;
  • apply themes;
  • add images, logos, etc.;
  • add validation rules;
  • etc.

Here is what a custom form looks like:

It has a new theme, a new image, new font sizes and colors, etc.

After the forms customization, we have to publish it into the SharePoint site.

Here is the browser look.

How to Create Anonymous Contact Form with SharePoint 2010


You may also be interested in: SharePoint Fest Denver 2013


 

Editor’s note: Contributor Khoa Quach is SharePoint Development Leader and developer at Affirma Consulting. Follow him @quachhongak

I recently received a request from a client which seemed very straight forward at first but ended being a little trickier than I expected. So hopefully this will help someone out.

  1. Client has a SharePoint 2010 publishing site
  2. Client wants to allow anonymous access to the entire site
  3. Client has a simple contact form. It needs to be a SharePoint list. Once submitted, it needs to email different internal groups depending on the subject selected.

Initial thought

Well, I thought it will be as simple as this:

  1. Set up the web application to allow anonymous access – pretty straight forward
  2. Go to the site collection (publishing site template, this is actually important)– allow access for anonymous user to the entire site collection
  3. Create the SharePoint list
  4. Provide “Add item” access to the Anonymous users.
  5. Create the Form using InfoPath – why not right?
  6. Create the SharePoint Workflows with “If” statements that redirect according to the subject selected from a Choice type of field. Start it when an item gets created. Publish.
  7. Test
  8. Done

Actually, if you go that route there are going to be a couple of issues:

  1. I encountered issues with the InfoPath form. Signed-in users were able to see the form but not anonymous access. Even, with the anonymous access set properly. I actually remedy this by disabling the following feature
  2. After that, the form was showing for anonymous users and at submission, the entry was added to the SharePoint list but the workflow was not kicking in for anonymous users. (Grrrrr….) There is actually a solution for that, I will develop later on.

Ok, well here is what I did. I think, from my research and different conversations I’ve had with other SharePoint techies, it is an acceptable solution. Please comment.

Solution:

  1. Set up the web application and the site collection for anonymous access.
  2. I am not going to expand on this as there are plenty of great articles out there that will describes step by step how to go about this. The following article is the one I used: http://www.topsharepoint.com/enable-anonymous-access-in-sharepoint-2010

    At this point we should be able to access the SharePoint site anonymously. Yay!

  3. Create the SharePoint list
  4. This depends on your requirements. Let’s say that our form will contain the following fields:

    • Title | single line of text | required
    • Subject | Choice (HR/Marketing/IT) | required
    • Body | Multiple lines of text | required
    • Simple enough, now let’s give “Add item access to the anonymous users”

    • Go to your newly created SharePoint list, go to the list permissions
    • Stop inheriting the permissions (if not already done)
    • You should see the Anonymous Access icon
    • Once you click on it, select the “Add items” option checkbox. This should be good for our scenario but feel free to add more options if necessary
    • Note: I had the options originally greyed out and was not able to activate. If you are in the same situation, this may be because of list settings >> advanced settings >> item-level permissions. Do not set to “Read items that were created by the user” or “Create items and items and edit items that were created by the user”
    • Click OK

OK. At this point we provided the ability to our anonymous users to add items.

Then create your InfoPath form. I will not go into detail and assume that this is performed easily, there are no options in InfoPath that should be different from a regular InfoPath form on a portal (Hint: you have to go to SharePoint Designer. If you need further details on that I could write something in a future post).

However this is optional, you could use the default form provided by SharePoint or even create new forms from scratch.

At this point, there is going to be an issue if you try access your forms whether it is an InfoPath form or a regular SharePoint form page.

In fact, if you try to access the SharePoint list “All items” view or any of the form views (Edit/New/Display), your anonymous user will encounter an error message. From a SharePoint page displaying the InfoPath form in a web part, you will encounter an error message too.

Not good. I learned that since our SharePoint site collection template was the publishing site infrastructure, the SharePoint feature “ViewFormPagesLockdown” was actually impeaching anonymous users to access system settings pages. Therefore, we need to disable that feature. This also means that all the SharePoint lists and document libraries’ views will be accessible to anonymous users. (I have yet to find a way around web.config file? Any input is welcome)

Anyway, here is how to enable/disable:
http://blogs.msdn.com/b/russmax/archive/2010/01/22/lockdown-mode-in-sharepoint-2010.aspx

At this point our anonymous users can go and add new items to the contact form list.

Ok, last couple of steps.

Creating SharePoint workflows should be easy enough at this point. But I will hold off until I read this excellent article/solution at: http://blogs.ibs.com/duane.odum/lists/posts/post.aspx?id=19. In fact, your workflows will hang if run as an anonymous user. The reason why is that “SharePoint Designer workflows will not trigger for items added or updated by anonymous users. [Note: Prior to SP1, declarative workflows could run under System Account. If you have upgraded to SP1 then this is no longer possible. See comments below for possible solutions]" .

I follow, to the letter, the steps from the previous link and it worked out like a charm.

Note: If during your search you come across this article at: http://blog.furuknap.net/enabling-declarative-workflows-for-anonymous-users-in-sp20102007; this will not work for items added from the UI but only email added items. Good resource for another project though.

Source:

SharePoint: Validate Business Day in InfoPath Date Picker


You may also be interested in: The SharePoint Shepherd’s Guide for End Users from SharePoint Shepherd


 

Editor’s note: Contributor Bobby Chang is a SharePoint consultant. Follow him @bobbyschang

A user in a work setting often needs to exclude weekends and only account for business days when entering information. This post will demonstrate how to design a SharePoint form that determines whether a business day was selected from the date picker.

To better illustrate the steps below, I have attached the InfoPath template form (aka the finished product), if you would prefer to follow the logic from there

  1. Have your Data Field ready
    You’ll need 3 data fields. 1st to capture the date; 2nd to find out the day of the selected date; 3rd to determine whether that day is a business day. For this post, we’ll use these Data Fields as reference:
    • MyDate (Date field) = to capture user input
    • CalculatedDay (Whole Number field) = to determine the day
    • IsBusinessDay (True/False field) = to determine business day
    • Assign a formula as a default value in CalculatedDay field
      1. Click fx in Default Value of the CalculatedDay field
      2. Click “Edit XPath (Advanced)”
      3. Paste the following formula (NOTE: I didn’t come up with this. I found it, but lost the reference. If you know of the person who BRILIANTLY came up with this, please let me know so I can give the proper respect/kudos/credit.):

      4. (number(substring(../my:MyDate, 9, 2)) + number(number(substring(../my:MyDate, 1, 4)) - floor((14 - number(substring(../my:MyDate, 6, 2))) div 12)) + floor(number(number(substring(../my:MyDate, 1, 4)) - floor((14 - number(substring(../my:MyDate, 6, 2))) div 12)) div 4) - floor(number(number(substring(../my:MyDate, 1, 4)) - floor((14 - number(substring(../my:MyDate, 6, 2))) div 12)) div 100) + floor(number(number(substring(../my:MyDate, 1, 4)) - floor((14 - number(substring(../my:MyDate, 6, 2))) div 12)) div 400) + floor(31 * number(number(substring(../my:MyDate, 6, 2)) + 12 * floor((14 - number(substring(../my:MyDate, 6, 2))) div 12) - 2) div 12)) mod 7
        

      5. Replace all of my data source with yours by doing the following:
        1. Highlight the first reference of “../my:MyDate”
        2. Click “Insert Field or Group”
        3. 2012-11-01-InfopathDatePicker-01.jpg

        4. Select your date field then click OK
        5. Repeat the steps and replace all references of “../my:MyDate”
      6. Click “Verify Formula” and you want to see a no error confirmation like shown below
      7. 2012-11-01-InfopathDatePicker-02.jpg

      8. When a date is selected by the user, this field will now generate a number from 0 to 6 that corresponds to a particular day (0 = Sunday; 1 = Monday; 2 = Tuesday; … 6=Saturday)
      • Create a rule to account for Business Day
        1. Select CalculatedDay field
        2. Click Manage Rules on the ribbon
        3. Add a new action “Mark as Business Day”
        4. Create the following Condition:
            CalculatedDay “is greater than or equal to” 1
            AND
            CalculatedDay “is less than or equal to” 5
        5. Add the following action
          • “Set a field’s value”
          • 2012-11-01-InfopathDatePicker-03.jpg

          • Select field of “IsBusinessDay”
          • Assign the value of true
            1. Click fx
            2. Insert Function
            3. Find and select “true”
            4. Click OK
        6. Click OK
        • Create a rule to account for Weekend
          1. Select CalculatedDay field
          2. Click Manage Rules on the ribbon
          3. Copy the Business Day rule from above and change the action name to “Mark as Weekend”
          4. Update the Condition to:
              CalculatedDay “is equal to” 0
              OR
              CalculatedDay “is equal to” 6
          5. Update the action to:
            • Field = “IsBusinessDay”
            • Assign the value of false
              1. Click fx
              2. Insert Function
              3. Find and select “false”
              4. Click OK
          6. Click OK
          7. The CalculateDay field rules should look as follow

          2012-11-01-InfopathDatePicker-04.jpg

        And there you have it.

        You now have a Boolean identifier in the IsBusinessDay field that you can use to validate the date input. One potential scenario is to disable a submit button if the user were to select a non-business-day. Another scenario is one that I have shared in the sample Form Template – there’s an error message and a validation flag on the Date field, should a weekend date is selected by the user. Here’s a screenshot of the form in Preview mode:

        2012-11-01-InfopathDatePicker-05.jpg

        SharePoint Getting ‘The “BrowserFormWebPart” Web Part appears to be causing a problem’ error when opening InfoPath form


        You may also be interested in: SharePoint App Development by mindfiresolutions


         

        Editor’s note: Contributor Alex Choroshin is a Sharepoint Team Leader at Bank Leumi. Follow him @choroshin

        Recently we had a problem when our end users got ‘The "BrowserFormWebPart" Web Part appears to be causing a problem’ error when trying to open an InfoPath form. The problem seemed to be related to some permission issues but we haven’t found any solution.

        After a couple of attempts we found a workaround to this problem.

        All you need to do is to Publish the form again preferably in a new library.

        This should fix the problem (at least it worked for us2012-09-26-BrowserFormWebPart-01.png)

        It seems that there may be some bug involved and after publishing the form again it some how fixes the problem.

        Hope you find this post helpful2012-09-26-BrowserFormWebPart-01.png

        see u next time…

        SharePoint - InfoPath 2010: Form Library Modal Popup


        You may also be interested in: SharePoint-based solutions by B&R Business Solutions


         

        Editor’s note: Contributor Chris Grist is a SharePoint Architect at Beach Energy. Follow him @gristdog

        In the last couple of weeks I have worked on several InfoPath projects which are using form library’s to save the completed form. However I did not like the way the user was navigated away from the site to enter a new form, several of these forms I wanted to be rapidly completed and therefore I started to look at a different way to open the forms.

        Of course in SharePoint 2010 we have the modal popup dialog, and after looking at a list form that had been customised with InfoPath, it appeared that it was possible to have an InfoPath form load inside a modal popup.

        The rest of this post details how you would achieve this.

        The first step is to get your form ready and published, once this is complete head over to your form library and click add a new item.

        Once the form has loaded copy the URL:

        2012-07-30-FormLibModalPopup-01.png

        You will end up with something that looks like:


        <a href="https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&DefaultItemOpen=1">https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&DefaultItemOpen=1</a>
        

        If you were to create a normal hyperlink to the above address, the chances are it will try and open in InfoPath client, so therefore we need to remind it to open in the browser using the syntax OpenIn=Browser. Therefore the link we now have saved looks like the following:


        <a href="https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&OpenIn=Browser&DefaultItemOpen=1">https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&OpenIn=Browser&DefaultItemOpen=1</a>
        

        To open a form inside a modal popup, SharePoint 2010 uses JavaScript which is linked to in the following format:


        <a onclick="javascript:NewItem2(event, "INSERLINKHERE");javascript:return false;" target="_self">Open Form</a>
        

        Insert your link in between the quotes where it says INSERTLINKHERE. Then insert the hyperlink on to a page, I had trouble inserting directly on to a page but inside the a content editor web part works just fine.

        2012-07-30-FormLibModalPopup-02.png

        Now when we click the link you should receive a modal pop-up and not be redirected to a separate page.

        2012-07-30-FormLibModalPopup-03.png

        If you don’t need the ribbon controls it can look even slicker:

        2012-07-30-FormLibModalPopup-04.png

        InfoPath 2010: Display Version Number on a Form


        You may also be interested in: O’Reilly - SharePoint 2010 at Work


         

        Editor’s note: Contributor Chris Grist is a SharePoint Architect at Beach Energy. Follow him @gristdog

        Each time you save a form template with InfoPath, there is a version number that is incremented, shown below:

        2012-07-19-VersionNumber-01.png

        I find it useful to know which versions are being used, especially if I have to troubleshoot a reported issue.

        Thankfully it’s quite easy to display this version number on the form its self. To achieve this just add a calculated field to the form:

        2012-07-19-VersionNumber-02.png

        Then paste in the following to the XPath text field:



        2012-07-19-VersionNumber-03.png

        Now when you preview the form you will see the version number:

        2012-07-19-VersionNumber-04.png

        SharePoint: Create a Workflow Initiation Form for Approvals


        You may also be interested in: SharePoint Solutions In-A-Box from Alcero


         

        Editor’s note: Contributor Laura Rogers is a Senior SharePoint Consultant at SharePoint 911. Follow her @WonderLaura

        In SharePoint Designer workflows that are manually started, the initiation form is the page that has the “Start” button to kick off the workflow. In this 11 minute video, I show how to create an approval workflow that can be manually triggered.

        I walk you through:

        • Setting up the workflow so that after the approval process, the content approval status of the document automatically gets updated.
        • Customizing the initiation form in InfoPath, so that the needed approvers may be selected from a people picker, and the colors are modified.
        • Adding a “high priority” check box so that high priority item approvals are due in a more timely fashion than normal.

        This solution applies to only the enterprise version of SharePoint and SharePoint online. This does not include SharePoint Foundation because it uses browser-based forms, which are enterprise only.

        How can you learn more? This solution is actually an excerpt from chapter 10 of our book.

        Click to buy the book:

        Already own the book? Open it to Chapter 10, and follow the step by step instructions that start on page 256.