0

API RESULT

Hello,

the result of an API request is this 

{"data":[{"pec":"test@pec.it","history":[]}],"success":true,"message":"","error":null}

I would like only the value test@pec.it to be pasted into a text field. How can I do that?"

4 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 9 mths ago
    • Reported - view

    parseJSON(JsonResult).first(data).pec

      • Andrea.1
      • 9 mths ago
      • Reported - view

       

      This is my code, how do I implement your code?

      let header := {
              Authorization: "Bearer MYTOKEN",
              Accept: "application/json",
              'API-NUMBER': "MYAPI"
          };
      let myURL := "https://company.openapi.com/IT-pec/xxxxx";
      let response := do as server
              let response := http("GET", myURL, header, null);
              'Testo 2' := formatJSON(response.result)
          end;
      void

      • Ninox partner
      • RoSoft_Steven.1
      • 9 mths ago
      • Reported - view

       

      let header := {
              Authorization: "Bearer MYTOKEN",
              Accept: "application/json",
              'API-NUMBER': "MYAPI"
          };
      let myURL := "https://company.openapi.com/IT-pec/xxxxx";
      let response := do as server
              let response := http("GET", myURL, header, null);
              let resu := formatJSON(response.result);
              'The field you want to fill' := parseJSON(resu).first(data).pec
          end;

      Hope this helps.

      • Andrea.1
      • 9 mths ago
      • Reported - view

       

       

      wow, thank you!

Content aside

  • 9 mths agoLast active
  • 4Replies
  • 53Views
  • 2 Following