Oldestman57
Posts: 0
Joined: Thu Mar 31, 2016 9:15 pm

Populate list service where clause with text from input text box.

I have a list service with a where clause {"username":"test user 11"}; It is mapped to a list item named userlistItem and invoked on page load. It works.
I want to have text from an input box called "usernameinput" to replace "test user 11" in the service when I invoke it from a button named "list Userbutton". Screenshot
Image
Do I have to load the textbox input to a local storage variable and map the storage variable to the where clause.
Any help would be appreciated.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Populate list service where clause with text from input text box.

Hello,

Please use this input component in the "before send" mapping: https://docs.appery.io/docs/appbuilde...

Oldestman57
Posts: 0
Joined: Thu Mar 31, 2016 9:15 pm

Populate list service where clause with text from input text box.

Thanks for the fast response.
When I try to map the usernameinput text box to the where clause in the service. The list item for the user name is no longer visible on the page when I test it.
Does there need to be JS included to set the username field to the input text box?
Image
I tried ' {"username" : "usernameinput"};', didn't work.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Populate list service where clause with text from input text box.

Please add a JS code to that mapping arrow:
prereturn {"username" : value};/pre

Oldestman57
Posts: 0
Joined: Thu Mar 31, 2016 9:15 pm

Populate list service where clause with text from input text box.

Thanks so much, works great!

Return to “Issues”