Cannot get value with ObjectGetProp after update from 2016.95


Tinn Aphopchung

Hi, David
I meet some issue after update from 2016.95

2016.95 (03/31/2016)
* Fix a bug in the ObjectGetProp action which causes we can't get the expected object's property value if we try to use a variable for the object's property name. Thanks Terje!

This is my code from login view.Before I update it can get data.I use HttpClient Post method to get data array from mysql via php in json format.It response normally.


loginclient.Response = Httpclient can get data from json
ObjectGetProp cannot get my data out from array after I update to 2016.95

Do I miss something?


Tinn Aphopchung

Here,in console I rollback to 2016.94 and capture
v. 2016.94

v. 2016.95 update at 04/01/2016 (It 2016.96 in description but in program still 2016.95)

in older version can get data.


Tinn Aphopchung

I rollback for now.
I investigating...found error at sample json2
because json2 sample is the same code with my code
It cannot get value too

in console error


decsoft

Hello,

First of all, sorry for the inconveniences. And thanks for your feedback and research tin. Yesterday I fix a bug in the "ObjectGetProp" action, and, now they works as expected, however, we can't write something like this code now:

This simple "confuse" the App Builder code translator. What we must to do is something like the below one:

That is, the property name must be different to the result variable. So remember the below code doesn't work:

But this other works like expected:

I want to study this deeply, but this behaviour is not only related with this specific action, then, take note tin.



Tinn Aphopchung

I understood it thanks,David.It better to use other name that was not the same key name(it make me confuse too.But I copy your sample code from json2 sample hahaha)

Ps.You need to change code in json2 sample too.It will make newer confuse too.

thanks for quick support. David :)


decsoft

Hello tin,

Thanks for your considerations. The JSON2 sample has been fixed and AB is now updated. Certainly I need to study this kind of situation, because maybe I can take another approach, which allow us to name variables like object properties, etc.



Tinn Aphopchung

It better to be not the same name ,David.
(I don't know that can set not the same,that why I coding like that. lol


decsoft

Hello,

It better to be not the same name ,David.
(I don't know that can set not the same,that why I coding like that. lol

Probably the better can be to allow us to choose: use the same name or not to use it. :)



decsoft

Hello,

Probably the better can be to allow us to choose: use the same name or not to use it. :)

I made the appropiate changes in order to allow us to write code like this without problems:

Changes also affects to some other actions in the same way than the "ObjectGetProp" action.



Tinn Aphopchung

Thanks!!


decsoft

Hello,

Thanks!!

You're welcome!


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.