Tuesday, October 5, 2021

Upcoming birthday column - without aging your employees!

 Here is something I needed to do so many times, and I think I finally perfected it.

A simple HR request, is to show the employees upcoming birthdays, in a simple user friendly way without dating your employees! (So, without showing their birth year...)


I've come up with this simple way of handling this, using 3 columns.


First create a choice column for Month (01-12) and for Date (01-31).


Then, create a calculated column with output type "Date", using this formula:


=DATE(IF([Birth month]<TEXT(TODAY(),"MM"),YEAR(TODAY())+1,YEAR(TODAY())),[Birth month],[Birth date])


And boom - you will always get the employee's upcoming birthday in a date column that you can use to display on your site!


Explanation about the formula:

The formula will check if the birth month has past, and if so will use next year's birthday. Otherwise it will construct a date for the current year based on the month and date you entered before.

Want a cool way to show it?

Try our Calendar Plus web part:



Want an even cooler way? 

Use our brand new "Card" control:


Hope this helps!

Monday, November 12, 2018

Changing the edit link on SPFx remote list viewer to open in same page

Just had a customer asking how to change the default edit link action icon in the table control of the remote list viewer add-in.

Currently, it checks if the item has an edit link, and then opens it in a new window:
return item.dvp_EditFormUrl && window.open(item.dvp_EditFormUrl) || console.log('this item does not have a valid edit url.');
This customer asked to have the edit item open in the same page/tab.
These customizations and changes are exactly what our product excels in. It is actually very simple to change.

Step 1

Edit the web part. In the table control designer toolbar, click on the gear icon to open the control configuration panel:

Step 2

In the control configuration panel, locate the edit action and click on it to open the action's script editor:

Step 3

In the script editor you can change the icon, tooltip and script that this action runs.
Change the script to the following code to open it in a new window.
if(item.dvp_EditFormUrl) window.location = item.dvp_EditFormUrl + "&Source="+encodeURIComponent(window.location.href);
Note: we added the current window as the Source parameter. This will make the edit form redirect back to this current page when the user is done editing the item.

You are done. Click outside the dialog to close it.

Made a mistake? Want to revert back to default? No worries. Like all other properties, once you change their default value, a "revert to default..." option appears under the new value, allowing you to revert your changes to go back to defaults quickly.

Questions? Suggestions? Feel free to ask here in comments or email our support team.

Wednesday, August 29, 2018

Data view plus for SharePoint online (SPFx) template sample

And again... I love this web part so much I have to share another template I made with it.

For those who don't know, the data view plus is a versatile web part that connects to various data sources and display the data using several built in controls, plus it allows you to provide your own template for rendering.

Current data sources are:

  1. SharePoint List
  2. Aggregation of several SharePoint Lists
  3. Excel File
  4. Graph API
but more are added all the time.

So, I got an ask from our sales team to build a risk matrix sample template to a customer who was interested in this product.

Within a couple of hours of work I got this fully working template out to the customer - nothing but HTML and CSS work was needed!

Here is the result web part:


When hovering over a risk, here are the details:
You can see the filter control above the chart, and since this chart is built by custom HTML template - you can customize it as much as you want with full control on all rendering!

And of course, the data source can be any one of the supported data sources so you have a very flexible, custom tailored solution to fit any requirement your clients may have!

Note: The template is available in the sample templates of the custom control as of version 1.0.0.8 build #47
Note 2: This sample template relies on the following fields to exist in the data source:
Title: text
Probability: number or choice (1-5)
Severity: number or choice (1-5)
Project: any type
Risk Owner: any type