Skip to main content
Question

formula field to do an ajax request

  • July 16, 2019
  • 0 replies
  • 39 views

I'm attempting to get the IP address that a user accessed an app and made changes from...

Is a formula Field able to do this call?

something similar to:

var IPpromise = $.ajax({type: "GET",url: "https://api.ipify.org/?format=jsonp";,dataType: "jsonp"});


$.when(IPpromise).then(function(json) {
var ip = json.ip;
log.push("IP of User: " + ip);
});

A formula can do it but it has to be on a button click. Embedding your own Javascript requires that you initiate the action - so a formula can do it as a button. Else you'll have to use Image Onload. You can do a formula url and use the syntax:
 javascript: {

 }

else you can use a formula rich text and do an a tag with on onclick function


Chayce Duncan | Director of Strategic Solutions
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base

  • Author
  • Registered
  • July 17, 2019
Thanks for the response Chayce, I'm very familiar with the IOL technique from Dan, and I've actually used it to make this work for me.

I do the ajax on load, and if it mismatches what's already in this particular field, I update the record from the same onload... it's just a system field, so it doesn't change the user experience.