Skip to main content
Solved

URL formula -API_RunImport

  • Aug 26, 2024 2:36 PM UTC
  • 0 replies
  • 699 views

Forum|alt.badge.img+8

I would like to create a URL formula button -- that when clicked it will run a table to table import --- this is what I have created (did not work) 

var text URLONE = URLRoot() & "db/" & [Table ID] & "?act=API_RunImport&ID="&[TableImportID]&"";  

$URLONE

Best answer by MarkShnierYou

The advanced settings for your application there is a place to indicate whether or not you want to use application tokens. The extra level of security is up to you but for most of my clients I do not enable them unless there is some private healthcare data that they are concerned about. But if you do want to use application tokens then you need to create one and then use the syntax  

var text URLONE = URLRoot() & "db/" & [Table ID]

& "?act=API_RunImport&ID=" & [TableImportID]

& "&apptoken=xxxxxxxxxxxxx"; 

 

 

View original
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24

Lee once you run a API call you need to learn the user on a page or a record or a report. Here is an example which will simply refresh the page that they user is on after the API call.    

 

var text URLONE = URLRoot() & "db/" & [Table ID] & "?act=API_RunImport&ID=" & [TableImportID]; 

var text RefreshPage =  URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

 
$URLONE
& "&rdr=" & URLEncode($RefreshPage)


MarkShnierYou
Forum|alt.badge.img+24

Yes, it would have to be a Fomula Ruch textfield.

here ina low tech example.

 

var text Words = "Click here to Toggle";

var text Checkbox = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_12=" & not [checkbox];

var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

var text URL =
$Checkbox
& "&rdr=" & URLEncode($RefreshPage);

If([checkbox]=false,
"<a class=\"Vibrant Primary\"a href=" & $URL & ">" & $Words & "</a>", // blue
"<a class=\"Vibrant \"a href=" & $URL & ">" & $Words & "</a>")  // gray

// "<a class='Vibrant'>Vibrant</a>", // regular grey button
// "<a class='Vibrant Alert'>Vibrant Alert</a>", // yellowish
// "<a class='Vibrant Danger'>Vibrant Danger</a>", // red
// "<a class='Vibrant Primary'>Vibrant Primary</a>", // blue
// "<a class='Vibrant Snowy'>Vibrant Snowy</a>", // white
// "<a class='Vibrant Success'>Vibrant Success</a>" // Blue again


MarkShnierYou
Forum|alt.badge.img+24

.... That previous post with the long answer was me, just signed in under the wrong user ID