Page 6 of 7

Concatenating Database Output into a List Item

Posted: Tue Oct 28, 2014 12:27 pm
by Bhupinder Chawla

Hi Yurii,

This app needs no information from Office 365. I will have data in Appery only.

However, it should work only for users who are registered with our Office 365 setup.

So, I can get a user's User ID and Password and send it to Office 365 to authenticate (verify) if the user is active (valid) and once I receive this confirmation, only then the user will be allowed to proceed further on the app.

I do not want to keep 2 login informations. Only use what is in Office 365 for user authentication.

Can you please tell me how to do this?

Thanks!

Best Regards
Bhupinder Chawla


Concatenating Database Output into a List Item

Posted: Wed Oct 29, 2014 3:26 am
by Yurii Orishchuk

Hi Bhupinder,

He here is a login workflow that i can suggest for your case:

pre

1 Login into Offis 365.

2 If login is success - login into Appery.io DB with same credentials.

2.1. If login not success - make registration with these credentials, then get sessionToken.
2.2. If login success - get sessionToken.

3 Use received in 2nd step sessionToken to access DB.

/pre

Regards.


Concatenating Database Output into a List Item

Posted: Wed Oct 29, 2014 10:25 am
by Bhupinder Chawla

Hi Yurii,

I would want the application to work like this:

  1. Login into Appery.io mobile app.

  2. Send credentials to office 365 to authenticate

  3. If valid and active user, provide access to appery.io mobile app

    I need to know how to accomplish Step 2 and what Information will I get back from Office 365 in Step 3 for me to judge

    Let me know if you can guide me to do this.

    Best Regards
    Bhupinder Chawla


Concatenating Database Output into a List Item

Posted: Thu Oct 30, 2014 1:12 am
by Yurii Orishchuk

Hi Bhupinder,

Unfortunatly we didn't work with "Office 365" api.

But you can read more about autentification in "Office 365" here : http://msdn.microsoft.com/office/offi...

So to login you should use oauth 2.0. specification are here: http://tools.ietf.org/html/rfc6749

And here is details about oauth in Azure active directory: http://msdn.microsoft.com/en-us/libra...

Also we have tutorial : http://devcenter.appery.io/tutorials/...

Regards.


Concatenating Database Output into a List Item

Posted: Fri Dec 05, 2014 4:47 pm
by Bhupinder Chawla

Hi Yurii,

I have a new question. I am trying to write JavaScript for the Where portion of the Query in the Before Send Mapping option.

The query needs to return data between StartDate and EndDate (both dates are inclusive). StartDate is 12/01/2014 and EndDate is 12/07/2014 have data in the string format. No DatePicker is being used here.

The results are not forthcoming. The code is below:

var d1 = Date (localStorage.getItem(local_WeekStartDate));
var d2 = Date (localStorage.getItem(local_WeekEndDate));
return '{"OrderDate": {"$gte": "'+d1+'", "&lte": "'+d2+'"}}';

Let me know where I am wrong.

Best Regards
Bhupinder Chawla


Concatenating Database Output into a List Item

Posted: Fri Dec 05, 2014 4:48 pm
by Bhupinder Chawla

Hi Yurii,

I have a new question. I am trying to write JavaScript for the Where portion of the Query in the Before Send Mapping option.

The query needs to return data between StartDate and EndDate (both dates are inclusive). StartDate is 12/01/2014 and EndDate is 12/07/2014 have data in the string format. No DatePicker is being used here.

The results are not forthcoming. The code is below:

var d1 = Date (localStorage.getItem(local_WeekStartDate));
var d2 = Date (localStorage.getItem(local_WeekEndDate));
return '{"OrderDate": {"$gte": "'+d1+'", "&lte": "'+d2+'"}}';

Let me know where I am wrong.

Best Regards
Bhupinder Chawla


Concatenating Database Output into a List Item

Posted: Fri Dec 05, 2014 5:15 pm
by Bhupinder Chawla

Hi Yurii,

I have a new question. I am trying to write JavaScript for the Where portion of the Query in the Before Send Mapping option.

The query needs to return data between StartDate and EndDate (both dates are inclusive). StartDate is 12/01/2014 and EndDate is 12/07/2014 have data in the string format. No DatePicker is being used here.

The results are not forthcoming. The code is below:

var d1 = Date (localStorage.getItem(local_WeekStartDate));
var d2 = Date (localStorage.getItem(local_WeekEndDate));
return '{"OrderDate": {"$gte": "'+d1+'", "$lte": "'+d2+'"}}';

Let me know where I am wrong.

Best Regards
Bhupinder Chawla


Concatenating Database Output into a List Item

Posted: Sun Dec 07, 2014 11:03 pm
by Yurii Orishchuk

Hi Bhupinder,

Please us following code:

pre

var d1String = localStorage.getItem(local_WeekStartDate);
var d2String = localStorage.getItem(local_WeekEndDate);

var d1 = new Date(d1String ).toISOString().replace(/T.*/gi, "") + "T00:00:00.000Z";

var d2 = new Date(d2String).toISOString().replace(/T.*/gi, "") + "T00:00:00.000Z";

console.log("d1 = " + d1);
console.log("d2 = " + d2);

var whereObject = {
$and: [{
"OrderDate": {
$gt: {
"$date": d1
}
}
}, {
"OrderDate": {
$lt: {
"$date": d2
}
}
}]
};
return JSON.stringify(whereObject);

/pre

Note: "OrderDate" should be column with "Date" type.

Regards.


Concatenating Database Output into a List Item

Posted: Tue Jan 06, 2015 2:21 pm
by Bhupinder Chawla

Hi Yurii,

Happy New Year!

Is it possible to use SOAP to get data from an application?

Best Regards
Bhupinder Chawla


Concatenating Database Output into a List Item

Posted: Wed Jan 07, 2015 12:28 am
by Yurii Orishchuk

Hi Bhupinder,

Yes if this protocol based on web and XML.

Details are here: http://en.wikipedia.org/wiki/SOAP

You just can create service to external 3rd party api and use it in accordance to this API documentation.

Regards.