InfoPath | @SPJeff

InfoPath – Repeating Table Select One Primary Row

March 28, 2012 in Uncategorized

Need to ask users to select one row in a repeating table?   Then you’ll want to see the screenshots below.  There are four simple components:

  1. Repeating table has “rowNum” with default value formula to dynamically calculate a row number.   “count(../preceding-sibling::*) + 1” can be entered with XPath mode.
  2. Main non-repeating “selectedRow” field outside of the table.  Will store the user selection.
  3. Make Primary” button in the repeating table.  Action rules here update the “selectedRow” number.
  4. icon” section to show the actively selected row.  Formatting rules here show it only when selected.

 

Now when a user clicks the “Make Primary” the main non-repeating “selectedRow” value will be updated to have the number of the actively selected row.  Formatting rules will hide the button and display a green check mark instead.  This provides user feedback and makes for a more intuitive experience.

Also, this solution could be extended with checkbox icons for a more seamless feel.  Simply change the regular “Make Primary” button to a picture button with an image with an unchecked box.   Then update the section to have an image of a fully checked box.   There are many options to format the active/de-active row display.

xsn16   CLICK HERE to download the XSN file

 

image

image

image

imageimage

image

image

image

InfoPath Current User (AND Manager) Profile. Lumbergh Remix!

February 14, 2010 in Uncategorized

Recently I needed to get the current user and their manager’s Active Directory profile to auto-populate a form.   Itay Shakury wrote a great blog post titled Get the current user without writing code that covers the first need (current user) by reading UserProfileService.asmx. But I needed more.

xsn16 Download sample form – ADManagerDetails.xsn

The strategy was to use 2 data connections and query the 2nd with the manager user ID from the first.   At that point you can map any document text field to be ready only and get the default value from one of these data connections.

image

Action Steps

  1. New InfoPath form in design mode
  2. Add 2 receive data connections to http://sharepoint2007/_vti_bin/UserProfileService.asmx
  3. Name them “UserProfile” and “ManagerProfile
  4. Leave the input parameters empty.  It will default to the current user.
  5. Open form Rules and add steps to “re-query” the ManagerProfile:
    1. Set field’s value:  query subtree of ManagerProfile to “Manager” value from UserProfile data tree
    2. Query data connection ManagerProfile.  With the filter set, it will now return different data.
  6. Enjoy and tell your friends.

Video Walkthrough (05:57)

How to build the sample form (above download) in full step-by-step video.  Only 6 minutes!  Well worth the time.  Hot

InfoPath Current User (AND Manager) Profile. Lumbergh Remix! from Jeff Jones on Vimeo.

Hide the “Powered By InfoPath” logo

February 5, 2010 in Uncategorized

In working with InfoPath Forms Services in MOSS 2007 I found that the web based form experience is great.  And I like InfoPath but even I don’t want a logo bumper sticker to stare at all day.

By editing “ifsmain.css” on the SharePoint web front end’s 12 hive you can override the system styling to hide this element.   The IE developer toolbar helped me find the CSS class (ToolbarBranding) to add the “display:none” attribute.  Screen shot below.  Open-mouthed

 

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATELAYOUTSINCifsmain.css

 

image 

image

Return to Top ▲Return to Top ▲