ServiceNow WSDL Timezone needs to change to Users timezone - web-services

From Servicenow WSDL, am getting data in some time-zone format.
In Servicenow, there is a option to change the users timezone and get the data as expected . But if we change the timezone in servicenow, it didnt affect for the data which comes through servicenow-WSDL.
How to convert the timezone for the data get through WSDL. Is there any way available in servicenow to automatically convert ? or any idea to develope our own script/code to do the same?
Thanks for your time.

Something to keep in mind when working with SN web services is that by default all time values will come back in UTC time. You can ask for "Display Values" by setting request parameter "displayValue" to either "true" to get back only display values or "all" to get back both display values and direct values.
The Display value for a time field is resolved according to: user timezone preference, then by system timezone.
For example, you could get the WSDL with this request:
https://<instance>.service-now.com/incident.do?WSDL&displayValue=true
and then also include the &displayValue=true on the SOAP request:
https://<instance>.service-now.com/incident.do?SOAP&displayValue=true
Here's a link to the product docs with more info about getting back display values through SOAP: http://wiki.servicenow.com/?title=Direct_Web_Services#Return_Display_Value_for_Reference_Variables
Note the same rules apply when using the REST interface as well, but the parameter is "sysparm_display_value" (http://wiki.servicenow.com/index.php?title=Table_API).
Hope this helps.

Related

Dynamic setting the timestamp fields in superset dashboards

I'm building few dashboards in Apache superset. All my available timestamp fields are in UTC timezone. (for example fields are, class_start_time & class_end_time).
I want that in the timezone the dashboard is opened all the timestamp fields will be automatically converted.
For example, I'm opening dashboard in Norway , so the UTC data should be converted to CET timezone of Norway.
I have tried to add some value here in Hours offset but its not working.
Can you please guide how we can achieve this.?
Just for reference :
In Kibana dashboards (ELK stack) have feature to automatically convert the timezone into which it is being opened. So I need same thing in Superset.
Normally you would be able to set this with environment variables when you start the program or container. In Apache Superset, this is not possible. There is an ongoing discussion on Github about this issue. One GitHub user posts the problem and workaround, which is far from workable:
Daylight savings causes issues where users have to update datasource
timezone offset for each datasource twice per year.
So the only thing you can do is update the hours offset twice a year. To make matters even worse, if you use Postgresql, this may not even be possible due to a bug as described here.

Connecting Reports to Web APIs with Parameters

I have a client that has a large number of customers, and I have reports that can accept parameters and pass to a REST-based Web API to pull, for example, customer-specific records. This, of course, is easy using Power BI.
The challenge is, there could literally be 500,000 records out there, so filters and passing filters is not really an option. What I need to do is pass a value via Power BI Embedded to the report that will update the parameter of the Web API dynamically.
Such as https://services.server.com/api/customers/{customerId}
.
I have read and experimented with about every technique possible, and yet I still can't seem to pull this simple (and common) scenario off. To confirm, this is would work fine if I allowed a user to filter these values manually, but the goal is to have the Web.Content value be dynamic (like via a parameter) and then the parameter (like CustomerId) get fed to the report externally, like in a Power BI embedded parameter to the report.
Again, this can't be a filter, I just want to do what you used to be able to do with SSRS or Crystal Reports and send something like {parameter} = (or eq) '{some value}' and have the report use that as the datasource JSON feed.
Any thoughts on this frustrating situation?
You can do this with RLS:
https://learn.microsoft.com/en-us/power-bi/developer/embedded-row-level-security
Bring all the 500,000 records to your pbix.
Define a role which will filter based on an username.
When embedding, pass the role and the desired username to the embed token.

Django international site with UTC

I am writing a site to be served internationally across multiple timezones.
In the settings.py:
TIME_ZONE = 'UTC'
USE_TZ = True
I am wondering if someone from NZ puts in a datetime via models.DateTimeField, does it automatically picks up the current timezone and convert to UTC without any extra code?
I am a bit confused on this paragraph:
The current time zone is the equivalent of the current locale for
translations. However, there’s no equivalent of the Accept-Language
HTTP header that Django could use to determine the user’s time zone
automatically. Instead, Django provides time zone selection functions.
Use them to build the time zone selection logic that makes sense for
you.
So do I have to override the save method to add the get_current_timezone()?
The key sentence there is: "However, there’s no equivalent of the Accept-Language HTTP header that Django could use to determine the user’s time zone automatically."
So there's no way for Django to reliably figure out your NZ user's time zone. It's not going to give you the user's time zone - you have to tell it! Specifically, until you explicitly activate() a time zone, the current time zone is just UTC as you defined in your TIME_ZONE setting.
When it comes to user input, the documentation says: "Django interprets datetimes entered in forms in the current time zone and returns aware datetime objects." So, if you've activated the appropriate NZ time zone then the conversion will happen as you expect. But if not, the datetime will be interpreted as being in your default UTC timezone.
How do you figure out the user's timezone? The documentation gives an example of how you can set it based on a value explicitly chosen by the user. I'm sure there are also services out there that try to guess the time zone based on the IP address. Either way, though, Django won't do it for you.

Why is Facebook Actions field is returning null value

In our API reports we noticed that we always get the Actions filed with no values.
after checking this with facebook support we understood that our request query was wrong. we are able to get the data with the following query that the suggested to us:
https://graph.facebook.com/act_52081533/adgroupstats?start_time=2013-04-22T00%3A00%3A00+-0700&end_time=2013-04-23T00%3A00%3A00+-0700&include_deleted=true&stats_mode=with_delivery&&limit=500&offset=0&access_token
I'm getting the same data as the UI present on 22/4/2013 but I don't understand why they are including 23/4/2013 date and why they using '+-0700'. The account time zone is GMT -8.
I read all documents referring this issue but could not found an explanation to this patters.

SSRS 2008 DateTime format issue

I have a web page accessing the SSRS web service and I have some sample reports created.
These reports have some datetime parameters with Available Values specified i.e. 17/07/2009
Report Manager runs the reports perfectly.
When I access the report in my web page and retrieve the parameters the available values for the datetime parameters appear in the format MM/dd/yyy i.e. 07/17/2009
parameters = rs.GetReportParameters(reportPath, historyID, forRendering, values, credentials);
If I update the value to the correct format I can pass the parameters to the report and they work as expected but atm I can't figure out where the conversion is taking place.
Admittedly I'm not too sharp on globalization [or should that be globalisation :)] so I may have missed something obvious.
The report language was changed to en and the page culture was changed to Culture="en-GB" in attempts to resolve the issue [in a quick and dirty way] but no luck
Regional Options on my workstation is set to English (Ireland)
All other parameters work as expected.
Any ideas anyone,
Thanks in advance
Liam
you must set language properties on textbox: Language: en-GB, and put regional setings on Web server where deploy report to English
it works for me, i have same problem with report localization.