Is there a full XML specification with all possible fields for the Yodlee DAG? - yodlee

Is there was a full specification of all the account fields that can be used with the DAG?
Specifically, I'm looking to simulate a 401(k) account with limited options for investments, which may or may not have a balance in them.

The default fields which appear when you create the DAG catalogue are all the fields which can be used. Here is an example of a 401 XML which you can upload to DAG investment and test it out.
<site>
<status>0<status>
<investmentAccount accountBaseType="retirement" acctType="401k" uniqueId="47802637">
<planNumber>25000</planNumber>
<planName>GENERAL Potters PSP</planName>
<accountName>GENERAL Potters PSP</accountName>
<hasInvestmentOption>1</hasInvestmentOption>
<accountNumber>13123534212</accountNumber>
<balance balType="totalBalance">
<curAmt curCode="USD">3588.65</curAmt>
</balance>
<holdingList>
<holding holdingType="mutualFund" uniqueId="-633856231">
<description>SSGA TRGT RET 2050 M SSGA TRGT RET 2050 M</description>
<dailyChange curCode="USD">27.13</dailyChange>
<price curCode="USD">10.449</price>
<quantity>343.445</quantity>
<value curCode="USD">3588.65</value>
<cusipNumber>85744W655</cusipNumber>
</holding>
</holdingList>
</investmentAccount>
</site>

Related

T-SQL XML node value

I'm trying to extract the values from the following xml document
<response>
<entry>
<title>the tales</title>
<subject-area code="1" abbrev="XX1">Test1</subject-area>
<subject-area code="2" abbrev="XX2">Test2</subject-area>
</entry>
</response>
but I'm having problem getting the subject-area text values i.e. "Test1"
I'm using the below T-SQL to extract the rest of the values, I'm using a cross appy on the node as I required this to loop to get all values so can't use [1] etc to extract it that way as I'm not sure how many subject area there will be.
Any ideas
SELECT
,a.APIXMLResponse.value('(response[1]/entry[1]/title[1])','VARCHAR(250)') AS Title
,sa.value('(./#code)','varchar(10)') AS SubjectAreaCode
,sa.value('(./#abbrev)','varchar(10)') AS SubjectAreaAbbrev
FROM [dbo].[APIXML] a
CROSS APPLY APIXMLResponse.nodes('response/entry/subject-area') AS SubjectArea(sa)
Although there is a working solution in a comment already, I'd like to point out some things:
Using just '.' as path can lead to very annoying effects, if there are nested elements.
Looking for performance it is recommended to use text()[1] to read the needed value at its actual place (Here are some details with examples).
As the internal values are NVARCHAR(x) it is slightly faster to use NVARCHAR as target type (if you don't have a reason to do otherwise...
That's my query:
SELECT
a.APIXMLResponse.value('(response/entry/title)[1]','NVARCHAR(250)') AS Title
,sa.value('#code','nvarchar(10)') AS SubjectAreaCode
,sa.value('#abbrev','nvarchar(10)') AS SubjectAreaAbbrev
,sa.value('text()[1]','nvarchar(10)') AS SubjectAreaContent
FROM #mockup a
CROSS APPLY APIXMLResponse.nodes('response/entry/subject-area') AS SubjectArea(sa)

ssis import xml attributes as elements

I have the following (this is just a sample) xml that is received from a third party (and we have no influence on changing the structure) that we need to import to SQL Server. Each of these files have multiple top level nodes (excuse me if the terminology is incorrect, but I mean the "CardAuthorisation" element). So some are CardFee, Financial etc etc
The issue is that the detail is in attributes. This file is from a new vendor. There is an xml file currently being received from another vendor which is a lot easier to import as the data is in elements and not in attributes.
Here is a sample:
<CardAuthorisation>
<RecType>ADV</RecType>
<AuthId>32397275</AuthId>
<AuthTxnID>11606448</AuthTxnID>
<LocalDate>20140612181918</LocalDate>
<SettlementDate>20140612</SettlementDate>
<Card PAN="2009856214560271" product="MCRD" programid="DUMMY1" branchcode=""></Card>
<Account no="985621456" type="00"></Account>
<TxnCode direction="debit" Type="atm" Group="fee" ProcCode="30" Partial="NA" FeeWaivedOff="0"></TxnCode>
<TxnAmt value="0.0000" currency="826"></TxnAmt>
<CashbackAmt value="0.00" currency="826"></CashbackAmt>
<BillAmt value="0.00" currency="826" rate="1.00"></BillAmt>
<ApprCode>476274</ApprCode>
<Trace auditno="305330" origauditno="305330" Retrefno="061200002435"></Trace>
<MerchCode>BOIA </MerchCode>
<Term code="S1A90971" location="PO NORFOLK STR 3372308 CAMBRIDGESHI3 GBR" street="" city="" country="GB" inputcapability="5" authcapability="7"></Term>
<Schema>MCRD</Schema>
<Txn cardholderpresent="0" cardpresent="yes" cardinputmethod="5" cardauthmethod="1" cardauthentity="1"></Txn>
<MsgSource value="74" domesticMaestro="yes"></MsgSource>
<PaddingAmt value="0.00" currency="826"></PaddingAmt>
<Rate_Fee value="0.00"></Rate_Fee>
<Fixed_Fee value="0.20"></Fixed_Fee>
<CommissionAmt value="0.20" currency="826"></CommissionAmt>
<Classification RCC="" MCC="6011"></Classification>
<Response approved="YES" actioncode="0" responsecode="00" additionaldesc=" PO NORFOLK STR 3372308 CAMBRIDGESHI3 GBR"></Response>
<OrigTxnAmt value="0.00" currency="826"></OrigTxnAmt>
<ReversalReason></ReversalReason>
</CardAuthorisation>
And what we need to do is be able to import this to various tables (one for each top level element type).
So for example CardAuthorisation should be imported to the "Authorisation" table, the CardFinancial should go to the "Financial" table etc.
So the question is what is the best method to employ to import this data.
Having read a bit, I understand xslt can be used for this and would be able to make the above into:
<CardAuthorisation>
<RecType>ADV</RecType>
<AuthId>32397275</AuthId>
<AuthTxnID>11606448</AuthTxnID>
<LocalDate>20140612181918</LocalDate>
<SettlementDate>20140612</SettlementDate>
<PAN>"2009856214560271"</PAN>
<product>MCRD</product>
<programid>DUMMY1</programid>
<branchcode>1</branchcode>
<Accountno>"985621456"</Accountno>
<type>"00"</type>
<TxnCodedirection>"debit"</TxnCodedirection
<TxnCodeType>"atm" </TxnCodeType>
<TxnCodeGroup>"fee" </TxnCodeGroup>
<TxnCodeProcCode>"30" </TxnCodeProcCode>
<TxnCodePartial>"NA" </TxnCodePartial>
<TxnCodeFeeWaivedOff>"0"</TxnCodeFeeWaivedOff>
<TxnAmtvalue>"0.0000"</TxnAmtvalue>
<TxnAmtcurrency>"826"</TxnAmtcurrency>
<CashbackAmtvalue>"0.00"</CashbackAmtvalue>
<CashbackAmtcurrency>"826"</CashbackAmtcurrency>
<BillAmtvalue>"0.00" </BillAmtvalue>
<BillAmtcurrency>"826" </BillAmtcurrency>
<BillAmtrate=>1.00"></BillAmtrate>
<ApprCode>476274</ApprCode>
etc etc
</CardAuthorisation>
But the info I read was quite old (4-5 yrs old) and I know SSIS is always being improved so not sure if it was still valid advice today?
Thanks in advance for your thoughts.

Extract incident details from Service Now in Excel

I am trying to extract ticket details from Service Now. Is there a way to extract the details without ODBC ? I have also tried the solution mentioned in [1]: https://community.servicenow.com/docs/DOC-3844, but I am receiving an error 9 -subscript out of range.
Is there a better way to extract details efficiently? I tried asking this in the service now forum but I thought I might get other opinions from here.
It's been a while since this question is asked. Hopefully following is still useful.
I am extracting change data (not incident) , but the process still should be same. You will need to gather incident table and column information. Then there are couple of ways to approach the problem.
1) If the data you are extracting has fixed parameters , such as fixed period or fixed column or group etc., then you can create a report within servicenow and then use REST/SOAP API to get the data in text/csv format. You can use different python modules to convert from csv to xls or xlsx depending on you need. I used openpyXL ,csv , xlsreader ,xlswriter etc.
See here for a example
ServiceNow - How to use SOAP to download reports
2) If the data has dynmaic parameters where you need to change columns, dates or filter etc, you can still use soap / REST API but form query within python scripts instead of having static report. This way you can change it based on your requirement on the fly.
Here is an example query for DB. you can use example for above. Just switch url with following.
table_name = 'u_change_table_name' #SN DB holding change/INCIDENT info
table_limit = 800
table_query = 'active=true&sysparm_display_value=true&planned_start_date=today'
date_query = 'chg_start_date>=javascript:gs.daysAgoStart(1)^active=true^chg_type=normal'
table_fields = 'chg_number,chg_start_date,chg_duration,chg_end_date' #Actual column names from DB and not from SN report.
url= (
'https://yourcompany.service-now.com/api/now/table/' +table_name +\
'?sysparm_query=' + date_query + '&sysparm_fields=' \
+ table_fields + '&sysparm_limit=' + str(table_limit)
)

SupplyCategoryUnavailable - what does this FBAOutboundServiceMWS error mean?

We have a script for submitting Amazon FBA orders via FBAOutboundServiceMWS, using CreateFulfillmentOrder request.
Orders for some products cannot be placed, we are getting this error:
<ErrorResponse xmlns="http://mws.amazonaws.com/FulfillmentOutboundShipment/2010-10-01/">
<Error>
<Type>Sender</Type>
<Code>InvalidRequestException</Code>
<Message>Value SupplyCategoryUnavailable for parameter MerchantSku is invalid.</Message>
</Error>
<RequestId>22dafce7-7457-4232-b994-efea4f386dca</RequestId>
</ErrorResponse>
There is no information about it in a documentation, and we do not see any difference between products which experience the issue and products which do not.
As it turned, those were SKUs called SNL – small and light program with amazon.com.
Below an answer from Amazon customer support which we have received:
Please confirm with if the items meet these conditions:
Weigh less than or equal to 8 ounces
Have dimensions less than or equal to 9x6x2 inches
Priced under $10
If the above mentioned conditions are met you have to do it manually

Yahoo Weather API 3 days Forecast with humidity value

I am building a web app, which uses Yahoo Weather API to provide weather information, based on a ZIP code, provided by the users.
I know that in order to obtain this data for certain number of days I have to add it as a parameter in my request, like so:
http://weather.yahooapis.com/forecastrss?p=33035&u=c&d=3
Which gives this result:
<channel>
....
<yweather:location city="Homestead" region="FL" country="US"/>
<yweather:units temperature="C" distance="km" pressure="mb" speed="km/h"/>
<yweather:wind chill="19" direction="90" speed="11.27"/>
<yweather:atmosphere humidity="78" visibility="16.09" pressure="1021" rising="1"/>
<yweather:astronomy sunrise="7:12 am" sunset="7:36 pm"/>
...
<item>
...
<yweather:forecast day="Wed" date="2 Apr 2014" low="19" high="28" text="Mostly Sunny" code="34"/>
<yweather:forecast day="Thu" date="3 Apr 2014" low="21" high="29" text="Partly Cloudy" code="30"/>
<yweather:forecast day="Fri" date="4 Apr 2014" low="20" high="28" text="Partly Cloudy" code="30"/>
<guid isPermaLink="false">USFL0208_2014_04_04_7_00_EDT</guid>
</item>
</channel>
However I need to be able to get the humidity level for EVERY day in the forecast and not just the current one. I've tried to find solution here and also read the Yahoo API documentation, but it's really a short one.
I've also tried http://www.myweather2.com/ and http://developer.worldweatheronline.com/, but they have the same issue with humidity - it's shown only for the current day and stripped from the whole forecast.
I'll keep trying with other free Weather APIs, but if you can help here I'd be very grateful.
I've spent some time researching for better APIs than the Yahoo! Weather API and I found something, that works for me, so I've decided to share the info, in case anyone else bump into this some day.
Version 2 of the Forecast API looks like a nice solution, because it provides detailed information, more specifically the humidity index for each day in the forecast, which was what I was looking for in the first place.
There are also number of libraries for this API (languages include PHP, Node.js, Python, Perl and others).
It works with longitude & latitude as in this example
https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE,TIME
and of course one needs to register for an API key.
The TIME parameter is optional, the temperature uses Fahrenheit metrics by default, but this can be changed with additional ?units=ca parameter.
One disadvantage is that you get only a 1,000 free calls per day, which probably won't be suitable for big applications.
If you know a better answer to the original question, I'll be very happy to hear it. Until then I'll use this solution, without going into much details:
// The default result from a Forecast API call is in JSON,
// so decode it to an object for easier access
$fcObj = json_decode($jsonResult);
if(!empty($fcObj->daily->data[0]->humidity)) {
// get humidity value in %
$humidty = $fcObj->daily->data[0]->humidity * 100;
}