Title: define new variables using remote API json data
Last modified: August 31, 2016

---

# define new variables using remote API json data

 *  [wlee20](https://wordpress.org/support/users/wlee20/)
 * (@wlee20)
 * [10 years ago](https://wordpress.org/support/topic/define-new-variables-using-remote-api-json-data/)
 * Hello,
    I wonder if anyone know how to define new variable (or new magic tags?)
   from some external API json data (e.g. live temperature from some weather API
   service) and use it in some other fields (e.g. simple math like unit conversion
   from fahrenheit to celsius in calculation fields)
 * I found some link that shows how to populate a dropdown field from a remote API
   json source, but it looks quite different from my application.
 * [https://calderawp.com/doc/caldera_forms_render_get_field_slug-field_slug/](https://calderawp.com/doc/caldera_forms_render_get_field_slug-field_slug/)
 * Any detailed explanation could be greatly appreciated.
    Thank you.
 * [https://wordpress.org/plugins/caldera-forms/](https://wordpress.org/plugins/caldera-forms/)

Viewing 1 replies (of 1 total)

 *  [scraido](https://wordpress.org/support/users/scraido/)
 * (@scraido)
 * [10 years ago](https://wordpress.org/support/topic/define-new-variables-using-remote-api-json-data/#post-7390665)
 * Hi wlee20,
 * you can write the API on your .php or as snippet and snippet in Caldera Forms
   in HTML element or in Pages.
 * Your Client can input Fahrenheit Degrees on Single Line Text Element and you 
   Passback it on Variables name it Fh with Value %Fahrenheit_Degrees%
 * So the snippet program can:
 * $fahrenheit_input = ( $_GET[‘Fh’] );
 * or
 * $fahrenheit_input = Caldera_Forms::do_magic_tags( ‘%Fahrenheit_Degrees%’, $_GET[‘
   cf_id’] )
 * And you can print the result in snippet program:
 * echo $celcius
 * Hope that helps, Tq

Viewing 1 replies (of 1 total)

The topic ‘define new variables using remote API json data’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/caldera-forms_475846.svg)
 * [Caldera Forms - More Than Contact Forms](https://wordpress.org/plugins/caldera-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/caldera-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/caldera-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/caldera-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/caldera-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/caldera-forms/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [json](https://wordpress.org/support/topic-tag/json/)
 * [variables](https://wordpress.org/support/topic-tag/variables/)

 * 1 reply
 * 2 participants
 * Last reply from: [scraido](https://wordpress.org/support/users/scraido/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/define-new-variables-using-remote-api-json-data/#post-7390665)
 * Status: not resolved