I am trying to calculate a school year from date of birth and would like SharePoint to update as and when necessary.
I know this is possible in Excel but wondered if there was a work around for Now or Today in SharePoint.
The code I am using is:
=IF([Date of Birth]="","","Year "&MAX(0,DATEDIF(DATE(YEAR([Date of Birth]+122),9,1),NOW(),"Y" )-4))
Any help would be greatly appreciated.
Sample forum to get year count between dates.
=VALUE(TEXT(NOW(),"yyyy"))-VALUE(TEXT([Date of Birth],"yyyy"))
if there was a work around for Now or Today in SharePoint.
Not by just using a Calculated Column. A Calculated column is only updated with the item is created or edited.
You can add JavaScript to the page to update the displayed school year each time a page loads, but you would need to add this to each of the list's forms and Views. The exact JavaScript solution depends on your SharePoint version. Can you update your question with the version? (2010, 2013, 2016, SharePoint Online - classic UI, SharePoint Online modern UI, etc.)
Related
I have been struggling for weeks to populate an"Events" web part with the dates of a sharepoint list.
Apparently list date entries are not considered events, so I started to look for a flow to convert any new or modified list date entry into a calendar event. After days of search, I am giving up. I cannot believe that such a simple task is becoming so complicated.
If anyone can shed some light on this matter I would me more than grateful!
I am trying SharePoint for first time. So please be nice to me. Here is what I am trying to do.
Lets say I have a List where I have values as shown below
Lesson Days
----------------------
Tennis Monday,Wednesday
Swim Saturday
Golf Sunday,Saturday.
Above Days is lookup field that can take multiple values.
How can I modify the view to look as below
Lesson Days
----------------------
Tennis Monday
Wednesday
Swim Saturday
Golf Monday
Sunday
Saturday
Looks like we can code, but I have no idea how to do this.
Also it would be awsome if we have sequence number for multiple values. Something like this
Lesson Days
----------------------
Tennis 1.Monday
2.Wednesday
Swim 1.Saturday
Golf 1.Monday
2.Sunday
3.Saturday
Edit: Based on further search looks like I need to do Client side rendering. I found this link
SharePoint 2013 Client Side Rendering: List Views
I am still struggling to understand this. Need much simple example on how to do this. Will appreciate any hint/help on getting this started.
To start this might help. Using Sample 1, changing the field name and the render function you can easily get the view version without sequence.
If you want a custom order on the days you have to change the EditForm for your days field to change the way the user inserts the days. That will be the hard part since if you do so, you have to either get the values for the lookup field by urself (using the javascript client api or rest calls) or use the default sharepoint lookupfield and customize it (I would not recommend this). To save the custom values back to the days field this example will help (using the registerGetValueCallback function)
You can include your script with a script webpart on the view page/edit page or use the jslink property on the webpart property section miscellaneous to include a javascript file containing the csr code.
I need to create a simple list column with the type of time and use it like a Start Time - End Time.
Recently, I found this sptimeonly and that's exactly all I really need. Unfortunately, looking at the instructions, I don't think it will work on SharePoint 2013 as it was obviously made for SharePoint 2010.
What choices do I have?
Do I need to develop some kind of custom field?
Is there any recommendation of where to start learning it? Kinda new to this platform, I'm sorry if these questions seem pretty basic.
Thanks!
I ended up using DateTime column with a default value of the Date set,
Then adding content editor webpart in the EditForm.aspx to embed css in order to hide the Date part.
I'm new to MOSS 2007. I need to create a workflow that looks at a document's review date (a select list predefined to values of 3 , 6 or 12 months) then send an email if the review date has passed.
So the workflow needs to get the documents review date then convert this to date time add to the created date if greater than current date send an email.
Can anyone tell me if this is possible to do using SP designer to create the workflow? I'dd be grateful for any pointers.
Many Thanks,
Nav
SharePoint Designer makes it very simple to create these kind of workflows. Have a look at this article.
Date manipulation can be a bit of a pain so if you need a little bit more flexibility and have the skills to write a little bit of C# or VB code (Visual Studio not required) then have a look at the Workflow Power Pack. There are plenty of examples on the associated blog.
Disclaimer, I worked on the WPP so consider me biased (It works great though :-)
You can do this with secondary workflows, that starts, update dates and finish.
Maybe I'm just crazy... So, with SPD I can add any time unit to a date and put that into a variable, but I can't seem to find anything that will let me calculate the difference between two dates. "Do Calculation" only lets me pick from numeric values. Am I missing something here? Seems like something which should be obvious.
Date comparison is not available "out of the box", but there are some workarounds.
Maybe this article: How to perform date calculations and construct dynamic strings in a SharePoint Designer workflow provides the answer?
Some more related information here: Modifying Date Formats in SharePoint Designer Workflows
You can use the function DATEDIF of SharePoint lists to set a column value and then use it in workflows. I am sure, this will help someone out there -
As of SharePoint 2013 you can use "Find Interval Between Dates" action.
Find Interval Between Dates
Calculates the time interval in minutes, hours, or days between two dates and stores the output in a variable.
https://msdn.microsoft.com/en-us/library/office/jj164026.aspx
String and date manipulation as well as calculations are a pain in SharePoint Designer workflows. The links Colin mentioned are good, but you may also want to consider embedding C# or vb.net code directly into your SharePoint Designer Workflow (Without the need for Visual Studio).
I wrote a component that allows you to do this and blogged about it at the following URL:
http://www.muhimbi.com/blog/2009/12/embed-c-or-vb-code-directly-in.html