@JonL@patrick@Teodor@George@ben
I understand there are many updates happening but can someone offer some guidance to this issue??
does anyone know how to properly handle serverside api resquest/response when the response is plain/text.
api request fetch schema returned by wappler is as follows:
Whats the proper way to parse this response server side so that the address can be extracted…(267 COLUMBUS AVE) in this example address2: 267 COLUMBUS AVE.
When making the api call the response returned is {“verifyAddress”:{“status”:200,“headers”:{“content-length”:“705”,“content-type”:“text/plain; charset=utf-8”,“request-context”:“appId=cid-v1:31e8f586-5343-4d41-a0cf-1fc2a950e1d2”,“date”:“Thu, 01 Oct 2020 16:00:45 GMT”,“connection”:“close”},“data”:"{\n “_declaration”: {\n “_attributes”: {\n “version”: “1.0”,\n “encoding”: “UTF-8”\n }\n },\n “AddressValidateResponse”: {\n “Address”: {\n “_attributes”: {\n “ID”: “0”\n },\n “Address1”: {\n “_text”: “# 2”\n },\n “Address2”: {\n “_text”: “267 COLUMBUS AVE”\n },\n “City”: {\n “_text”: “NEW YORK”\n },\n “State”: {\n “_text”: “NY”\n },\n “Zip5”: {\n “_text”: “10023”\n },\n “Zip4”: {\n “_text”: “2904”\n }\n }\n }\n}"}}… but the next step in the flow is to use this data to create an address object and store to the database… fields1: 267 columbus ave field2: NY etc… but when I run the workflow the object is created… and none of the fields associated with this api call are added to the object
after inspecting the wf and database… the only fields that were actually populated were the fields that were filled but user data received directly from the user when submitting the form from the post request… but no data populates from the API request to validate the address… the request field says that the content-type is plain-text not application/json…
all the fields that are null should be populated by the data which is returned by the api request… i selected those fields cia the insert data sql query… @s.alpaslan