Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Local storage variable not mapping to request?

Hey there!

I'm trying to map a previously-set local storage variable to a JSON request, but for an unknown reason, it's not working. Attached is a picture of what I'm trying to do.

I'm assuming that, once "answer" is set (It's set on the previous screen. I've confirmed this) it should just be filling in that value on the request. However, that request is returning NULL, not the value of the local variable.

Am I missing something obvious? Image

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Local storage variable not mapping to request?

Check to make sure the value is passed, add console.log(value) to the mapping of that variable.

Check also the service request.. to see what's going on there.

Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Local storage variable not mapping to request?

By playing with default values, I've confirmed that the service is not being run at all! This doesn't make any sense, because everything appears to be set correctly.

When I access the JSON directly (http://URL.com/WHATEVER.php?a=1&b=2&c=3) the JSON executes correctly. (It also updates a MySQL table, so I am able to confirm the script is being run that way) However, when I load the screen, my database remains unchanged, indicating that the service is not being run.

Note my settings for the service in the image below. It should be working! When I test the service using the "Test" feature using the same parameter values, it works correctly. However, when I test it on the screen itself (forcing the same parameter values, avoiding local variables etc) the service does not run.

How can I troubleshoot this? The problem seems really illogical to me. It shouldn't be occurring the way it is.

Image

Sergey Kozyr
Posts: 0
Joined: Tue Apr 30, 2013 2:55 pm

Local storage variable not mapping to request?

Hello
Are you sure that you filled all request parameters right in datasource mapping?
To debug your application in browser use Chrome Developer tools (F12 hotkey). You could see all requests to rest services in Network tab.

Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Local storage variable not mapping to request?

Yes, I'm sure! I'll attach another picture to show more of the service's settings.

Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Local storage variable not mapping to request?

Here are more pictures of the settings I'm using. As you can see, everything looks like it should. The service works when tested directly in the service's respective tab, but not when tested on the actual application. I'm using the Appery proxy, so this shouldn't be an issue.

Image

Sergey Kozyr
Posts: 0
Joined: Tue Apr 30, 2013 2:55 pm

Local storage variable not mapping to request?

Could you send us a screenshot of Network tab in Chrome Developer tools when you start application in browser? Also "XHR" filter in Network tab must be turned on. This would help us to see all requests to rest services.

Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Local storage variable not mapping to request?

Is this what you're looking for? This is what showed up once XHR was turned on, and I navigated to the screen that is supposed to be calling the service. That is not the start page, but it is the first page I navigated to. (if that's relevant)

If I'm looking at what I think I'm looking at, it doesn't appear the service is being called.

Image

Sergey Kozyr
Posts: 0
Joined: Tue Apr 30, 2013 2:55 pm

Local storage variable not mapping to request?

Do you call Rest service on page load or on some other event?

Nathanael
Posts: 0
Joined: Tue Dec 11, 2012 11:25 pm

Local storage variable not mapping to request?

Gah, that was it. For some reason, I completely forgot that the service has to be invoked, even when it's tied to the screen. I just assumed it was automatic. Thanks for your help and time!

Return to “Issues”