rest api - Extract XMLJSON element from Zillow API response and populate into Gravity Forms field

Given this stack:WordPress 5.3GravityForms 2.4.15.6 (paid: common, right?)Forms: 3rd-Party Integration (free: Link to

Given this stack:

WordPress 5.3
GravityForms 2.4.15.6 (paid: common, right?)
Forms: 3rd-Party Integration (free: Link to WordPress plugin page)
Forms: 3rd-Party Inject Results (free: Link to WordPress plugin page)
Zillow GetSearchResults API (free: Link to Zillow API)

I've connected to Zillow's API and received the response contained in this file: Link to 3rd-Party Integration debug text file.

Now that I've connected, I am supposed to be able to extract either XML or JSON and replace/overwrite the contents of a given field (input_12) within the originating Gravity Form (or in my case, the confirmation) (visible here: link to Gravity Form) by following the instructions here link to 3rd Party Inject Results instructions on GitHub using a syntax that I simply can't figure out - something like:

XML

[env:Envelope/env:Body/ns1:Response/ns1:Resultstatus] => foo
[env:Envelope/env:Body/ns1:Response/ns1:Result] => bar
[env:Envelope/env:Body/ns1:Response/ns1:Description] => baz

or

JSON

[Body/Response/ResultStatus] => foo
[Body/Response/Result] => bar
[Body/Response/Description] => baz

in the Forms: 3rd-Party Inject Results field shown here: Dropbox screenshot

I am attempting to extract/display the "zestimate" element's "amount" field, but can't figure out the correct syntax/response path.

The successful Zillow XML response, along with the field(s) I need to capture can be seen in the text file here link to Zillow XML response

I have searched high and low, but correct syntax/formatting information is scarce on this specific topic/plugin, and I would like to accomplish this in the aforementioned stack, if at all possible.

I would greatly appreciate a guru's guidance in helping me format the correct syntax so I can get on with my freaking life. lol

Thanks in advance.

Given this stack:

WordPress 5.3
GravityForms 2.4.15.6 (paid: common, right?)
Forms: 3rd-Party Integration (free: Link to WordPress plugin page)
Forms: 3rd-Party Inject Results (free: Link to WordPress plugin page)
Zillow GetSearchResults API (free: Link to Zillow API)

I've connected to Zillow's API and received the response contained in this file: Link to 3rd-Party Integration debug text file.

Now that I've connected, I am supposed to be able to extract either XML or JSON and replace/overwrite the contents of a given field (input_12) within the originating Gravity Form (or in my case, the confirmation) (visible here: link to Gravity Form) by following the instructions here link to 3rd Party Inject Results instructions on GitHub using a syntax that I simply can't figure out - something like:

XML

[env:Envelope/env:Body/ns1:Response/ns1:Resultstatus] => foo
[env:Envelope/env:Body/ns1:Response/ns1:Result] => bar
[env:Envelope/env:Body/ns1:Response/ns1:Description] => baz

or

JSON

[Body/Response/ResultStatus] => foo
[Body/Response/Result] => bar
[Body/Response/Description] => baz

in the Forms: 3rd-Party Inject Results field shown here: Dropbox screenshot

I am attempting to extract/display the "zestimate" element's "amount" field, but can't figure out the correct syntax/response path.

The successful Zillow XML response, along with the field(s) I need to capture can be seen in the text file here link to Zillow XML response

I have searched high and low, but correct syntax/formatting information is scarce on this specific topic/plugin, and I would like to accomplish this in the aforementioned stack, if at all possible.

I would greatly appreciate a guru's guidance in helping me format the correct syntax so I can get on with my freaking life. lol

Thanks in advance.

Share Improve this question edited Nov 18, 2019 at 8:18 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Nov 17, 2019 at 23:56 KillerDesignerKillerDesigner 1013 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

the first step is to extract the value with this kind of code, does it work for you ?

$xml = simplexml_load_string($result);
$value = (string) $xml->response->results->result->zestimate->amount;

var_export($value, FALSE);

the next step is to put the value in the form. the Gravity Form is not free then we cannot test it and I only find that in documentation : https://docs.gravityforms/gform_get_field_value/
if that doesn't help, you have to ask to gravity form support.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744995538a4605167.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信