Page 1 of 1

Retrieve post data in RPGLE program. Autocomplete textBox

Posted: Tue Jan 07, 2020 6:28 am
by Estibarna
Hello,

We are trying to do a RPGLE program to process textbox autocomplete option with a UDF.

We have not found a way to process the data that is being sent to the program via POST. We have tested with DATA-INTO, but it seems that the data is not sent in JSON format.

The request form-data in google developer tools are:

query=dd&limit=25&AUTH=39FE4833B424D3695C820430E381C87D53A9773823E73370ACD8ABF4EBB0F62A&UTF8=Y

We need query variable to limit response data.

Thanks in advance.

Re: Retrieve post data in RPGLE program. Autocomplete textBox

Posted: Tue Jan 07, 2020 9:25 am
by Scott Klement
The data you are looking for is in the variable named 'query' that you see in the form data. In your example, it is set to 'dd'

To retrieve it in a Universal Display:

1. find the 'Input Parameters' property of your Universal Display record format
2. Click the '...' button in the property
3. Use the 'Add' button to add a new input parameter
4. Set the parameter name to 'query'
5. Set the bound variable to whatever you want the variable in your RPG program to be (maybe also 'query', with a large enough length to fit anything that might be typed into the textbox)
6. Save your changes, re-compile the Universal Display
7. Change your RPG program to READ the record format. After reading it, the variable you bound in step 5 will be populated with the 'dd'

Re: Retrieve post data in RPGLE program. Autocomplete textBox

Posted: Tue Jan 07, 2020 1:02 pm
by Estibarna
thank you very much Scott,

it works perfectly

Regards

Sergio