Docusign - date tab - formatting input - docusignapi

I am having difficulty specifying the format of the date tab to be inputted as dd/mm/yyyy. This is a date input tab, it is NOT the date signed tab.
I HAVE changed the account default regional settings to my time zone and changed the default date/time format for the account under regional settings. However, this appears to have no impact on the users input for the date tab upon signing.
I am using REST-api to send the tags, so please don't provide advice based on using a template! It has to be either in the account settings (of which there doesn't appear to be) or in the specification of the date tab in the code (I'm using c#).
click here to see example use
public static List<Date> CreateDateTabs(IEnumerable<Docusign_Date> DD)
{
List<Date> listTabs = new List<Date>();
foreach (Docusign_Date item in DD)
{
Date DS = new Date();
DS.DocumentId = item.DocumentGuid.ToString();
DS.RecipientId = item.PartyID.ToString();
DS.TabLabel = item.Party_Tag;
DS.AnchorString = item.Party_Tag;
listTabs.Add(DS);
}
return listTabs;
}

Your example shows a text tab, not a date tab.
I know it's confusing.
But in DocuSign if you want user to provide input date, you must use a text tab and set it such that the required format is for date.
Change your code to textTab, add formatting based on your requirement (first day (1-31), then month (1-12), then year) and you can even provide the error message if someone provides the wrong date.
Let me know if it's not clear and you need a code example.

Related

Power Apps Set Variable returning date after selected dated

In Power Apps, I am in the process of creating a Custom Form based off a SharePoint List. I added in an additional data source (excel file) that we are able to pull information from to autofill significant portions of the Custom Form. The issue is that it doesn't return the Date Selected but the following day (1/1/22 selected, 1/2/22 returned).
The code I am using is based off two pieces of user-input information. The ID of the individual and the date of the Activity. The code is as the following. It should return a mini table, which is important for further down the survey.
Set(Result, Filter(Table1,ID = ID.Text && (Text(ActivityDate, "mm/dd/yyyy") = Text(SelectedActivityDate.SelectedDate,"mm/dd/yyyy"))))
I do not see why the following date is being returned.

Office Script with Power Automate to Dynamically Change Excel Worksheet Date

I am using the following office script to hide a daily excel worksheet at the end of the work day. It runs fine when run from the script in excel, however, it fails when triggered by Power Automate at the end of the day using 23:00 EST. I believe this is due to differences in time zone utilized by Power Automate at the end of the day in my time zone Is there some way to define the correct time zone when triggering this near the end of the day via Power Automate?
function main(workbook: ExcelScript.Workbook) {
//Assign the "Template" worksheet to the ws variable
let date = new Date(Date.now());
let ws = workbook.getWorksheet(`${date.toDateString()}`);
//Set the visibility of the ws worksheet to hidden
ws.setVisibility(ExcelScript.SheetVisibility.hidden);
}
Time zones are tricky when it comes to the cloud. You cannot be 100% sure which time zone your code will end up running in. It really depends on where the data center of the cloud compute is located and how it's configured.
And locale (culture) makes things even worse when you need to convert date time objects to strings. The converted output might be different from culture to culture.
You'll have to always be explicit when working with dates and times.
I'd assume your Power Automate flow probably gets triggered at the correct moment if you have configured it explicitly with time zone information as you mentioned in your question (23:00 EST).
So I guess the following two API calls in your code might be the culprit:
Date.now() returns the current date time of the region (might be different from the one you live in) of the data center where your script is running in.
date.toDateString() returns the text representation of the date part of the date object, in current locale of the region (might be different from the one you live in) of the data center where your script is running in.
If what you want to do is to get the date part of the current EST time, I'm wondering if this could be helpful:
// You can find the time zone names from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
function currentDateStringInTimeZone(timeZone: string, locale: string = "en-US"): string {
return new Date().toLocaleDateString(
locale,
{
timeZone: timeZone
});
}
function main(workbook: ExcelScript.Workbook) {
//Assign the "Template" worksheet to the ws variable
let ws = workbook.getWorksheet(`${currentDateStringInTimeZone("America/New_York")}`);
//Set the visibility of the ws worksheet to hidden
ws.setVisibility(ExcelScript.SheetVisibility.hidden);
}
You need to pass in the expected time zone (you can find all the time zone names from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) and the expected locale (by default en-US). By default, the date string for America/New_York and en-US is in the format of 2/25/2022. If it doesn't match the format of your worksheet names, you may need to tweak the parameters of toLocaleDateString().
If it were me, I'd be determining the date from a PowerAutomate step and use it as a parameter rather that doing it from the office script directly.
Note: This assumes that you're always going to trigger this from PowerAutomate and users will not trigger it from the Automate tab in Excel Online directly.
As a really basic example, this is what my script looks like ...
function main(workbook: ExcelScript.Workbook, localDateTime: string) {
let worksheet = workbook.getActiveWorksheet();
worksheet.getRange("A1").setValue(localDateTime);
}
... you can see, I have a localDateTime parameter which is then able to be populated through the PowerAutomate flow.
In the flow itself, I have it looking like this ...
The Local Date Time variable expression looks like this ...
formatDateTime(convertFromUtc(utcNow(), 'AUS Eastern Standard Time'), 'yyyy-MM-dd hh:mm')
That expression gives me the date and time exactly as I want it in my timezone. For the purpose of this demonstration, I've gone down to the hour and minute to show it's true accuracy and as I'd hoped to achieve, this is the outcome ...
Just ignore the AM in the address bar, it's treating the string in the cell as a date/time based on what it received but you won't be doing that, you'll just be using the date to show/hide your worksheet.
If it needed to be stored in a cell then I’d have to make the string a little more stringent and include the AM/PM or make it 24-hour or something.
So if your expression in PowerAutomate was like this ...
formatDateTime(convertFromUtc(utcNow(), 'Eastern Standard Time'), 'yyyy-MM-dd')
... or whatever the yyyy-MM-dd format is for your worksheet name then it should work as you need.

How to insert auto update date field in dynamics CRM?

I've created an email template for case entity. I want to insert a date field in that template so that whenever user is going to use the template the date field must be updated. For example, I've inserted the date today and the user is going to use it on February 06, 2014. The field must be updated automatically and the updated date must be shown to the user.
How can I use this in to fulfill my requirements. or is there any work around?
Thank You.
As dynamic fields like the one you need cannot be added in an email template in the CRM (i believe it is not possible to add javascript into an html template),
you can achieve this with the following workaround:
In your email template add a string that will be easily recognizable and unique in the code. for example DATE.NOW
Then register an onchange event on the description field on the email form.
In the event replace the DATE.NOW string in the description field with current date generated, printed in desired format in javascript.

Changing date format in display templates for SharePoint 2013

I have a Content Search Webpart that uses a customized Display Template to display results of recent changed documents.
I would like to show the "last modified-date" below the document Title.
I can then use #= ctx.CurrentItem.ModifiedOWSDATE =# to get the date, however the returned date is displayed as 2013-05-16T12:54:10Z.
How can I format the date so it is displayed like 16.05.2013 - 12:54 ?
iirc SharePoint should handle the date conversion if you use the same approach as you do with new Property Mappings.
Copy/paste a variable in the template, something like:
var modifiedDate = $getItemValue(ctx, "ModifiedOWSDATE");
modifiedDate.overrideValueRenderer($contentLineText);
And use that variable instead:
<p>_#= modifiedDate =#_</p>
If creating a new custom Value Renderer etc is not an option for formatting the date (The default pattern used by Search.ClientControls isLongDatePattern I think). One could always create a Date variable, and do as fit:
Example:
<p>_#= new Date(modifiedDate["inputValue"]).toLocaleString() =#_</p>

How to get the Current Date & Time Automatically to a Date Time Field

I have created a date time field I made today's date as the default value, Then I added it to a page layout and created a page, But the current Date Time is not picking up from the system.
I dont want to give the user to select a Date Time instead it should populated automatically
Is there anyway to achieve this without writing code in code behind files?
This is very similar to this question I think
SO - How to get Date and current time from the Date/Time column in SharePoint Custom list
My answer there gives a few options such as using the built in Created field, using a calendar template, a JavaScript hack and a custom field type.
Guys, fake [Today] trick worked for us - but prob is we only got the date value not datetime.
Janis, is it possible to get date and time both from the fake [today] column trick? pls refer few articles on the same
Does [Today] work?
If you have language pack applied to SharePoint, then you must use localized "Today" string.

Resources