Title: About the Data Extraction Problem
Last modified: January 12, 2024

---

# About the Data Extraction Problem

 *  Resolved [klingbeil](https://wordpress.org/support/users/klingbeil/)
 * (@klingbeil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/)
 * Hello;
   I pulled data using the API with a php file. I also have the data I capture
   calculated as JSON in the calculated fieldname field.But the problem is that 
   while you can print the result; The value I calculated does not appear in the“
   calculated fieldname” field.
 * How can I solve this problem?
 * criterion92 output appears. but it does not appear in the calculated fieldname
   field that I defined.
   I would be very happy if you could suggest a solution.
 *     ```wp-block-code
       (function () {
       	var criterion92 = '';
           jQuery.ajax({
               url: 'https://www.xxx.com/xx.php',
               dataType: 'json', 
               success: function (response) {
                   var criterion92a = response.data;
   
       		criterion92 = PREC(criterion92a * fieldname44 * 7.216,2,true);
                   jQuery('#calculation-criterion92').html(criterion92);
   
               },
               error: function (error) {
                   console.error('Error fetching data:', error);
               }
           });
       })();
       ```
   
    -  This topic was modified 2 years, 5 months ago by [klingbeil](https://wordpress.org/support/users/klingbeil/).

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17338357)
 * Hello [@klingbeil](https://wordpress.org/support/users/klingbeil/)
 * Please include the link to the page that contains the form. I cannot know if 
   the data are read properly, or if the element ID is correct without checking 
   your code in action.
 * Best regards.
 *  Thread Starter [klingbeil](https://wordpress.org/support/users/klingbeil/)
 * (@klingbeil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17338394)
 * [link](https://www.guldem.com.tr/?cff-form=14)
 * As an example, I gave the output criterion92 field. I left the area open for 
   you to see.
   The output comes but it doesn’t fill the space.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17338676)
 *  Hello [@klingbeil](https://wordpress.org/support/users/klingbeil/)
 * The issue is simple. Your form 14 does not include any tag with ID `calculation-
   kriter92`
 * So, the piece of code `jQuery('#calculation-kriter92')` does not select any element.
 * Best regards.
 *  Thread Starter [klingbeil](https://wordpress.org/support/users/klingbeil/)
 * (@klingbeil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17338700)
 * It actually selects it in the code.
   Frankly, I don’t understand exactly what 
   the problem is;
 * The code below gives output in the function in the section. but it doesn’t fill
   the fieldname53 field.
 *     ```wp-block-code
       (function () {
       	var kriter92 = '';
           jQuery.ajax({
               url: 'https://www.xxx.com.tr/xxx/xxx.php',
               dataType: 'json', 
               success: function (response) {
                   var kriter92a = response.graltinalis;
   
       		kriter92 = PREC(kriter92a * fieldname44 * 7.216,2,true);
                   jQuery('#calculation-kriter92').html(kriter92);
                   jQuery('.kriter92-aciklama').html('Çevrilen Miktar : ');
                   jQuery('.kriter92-sonuc').html(FORMAT(kriter92, { groupingsymbol: ".", decimalsymbol: "," }) + ' TL');
               },
               error: function (error) {
                   console.error('Error fetching data:', error);
               }
           });
       })();
       ```
   
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17338804)
 * Hello [@klingbeil](https://wordpress.org/support/users/klingbeil/)
 * The selector `#calculation-kriter92` means there is a tag with ID `calculation-
   kriter92` but your form 14 does not includes a tag with that ID.
 * Best regards.
 *  Thread Starter [klingbeil](https://wordpress.org/support/users/klingbeil/)
 * (@klingbeil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17338841)
 * How can I solve the problem? I’m a little confused. Have you shared the updated
   code?
   thanks
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17338873)
 * Hello [@klingbeil](https://wordpress.org/support/users/klingbeil/)
 * Please insert an “HTML Content” field in the form, and enter the following tag
   as its content:
 *     ```wp-block-code
       <div id="calculation-kriter92"></div>
       ```
   
 * And your code will display the value of kriter92 in this tag.
 * Best regards.
 *  Thread Starter [klingbeil](https://wordpress.org/support/users/klingbeil/)
 * (@klingbeil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17339140)
 * Hello;
   You still don’t understand my problem sir. I already get it as output,
   it appears in my code above.
 *     ```wp-block-code
       calculation-kriter92
       ```
   
 * It comes as output. But this is what I calculated. It does not appear in the 
   fieldname53 field where I made the calculation.
   For this reason, I cannot calculate
   the data I collected. It just comes as output.
 * I tried the div tag you gave and it gives output in the form.
 * ![](https://i0.wp.com/i.hizliresim.com/88oo95m.PNG?ssl=1)
 * ![](https://i0.wp.com/i.hizliresim.com/iawaj1e.PNG?ssl=1)
 * It’s clear enough. The problem is that no data is received in the fieldname53
   field.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17339155)
 * Hello [@klingbeil](https://wordpress.org/support/users/klingbeil/)
 * You’re reading the values with AJAX, and AJAX works asynchronously. When the 
   server sends the response, the equation thread is not active. So, you have two
   alternatives: you can use the cffProxy operation ([https://cff.dwbooster.com/blog/2019/05/17/third-party-connection-module](https://cff.dwbooster.com/blog/2019/05/17/third-party-connection-module))
   or simply, include the following piece of code to assign the field’s value directly
   after receiving the server response:
 *     ```wp-block-code
       getField(fieldname53|n).setVal(kriter92);
       ```
   
 * Best regards.
 *  Thread Starter [klingbeil](https://wordpress.org/support/users/klingbeil/)
 * (@klingbeil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17339178)
 * Thank you
    -  This reply was modified 2 years, 5 months ago by [klingbeil](https://wordpress.org/support/users/klingbeil/).

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘About the Data Extraction Problem’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [klingbeil](https://wordpress.org/support/users/klingbeil/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/about-the-data-extraction-problem/#post-17339178)
 * Status: resolved