ContributionsMost RecentMost LikesSolutionsRe: Can Code Pages Reference Table Values? James, Here are a couple of links that might be helpful in understanding how to use code pages: https://helpv2.quickbase.com/hc/en-us/articles/4570389110036 https://community.quickbase.com/blogs/evan-martinez1/2021/07/09/alternatives-to-common-javascript-insertion-techni https://helpv2.quickbase.com/hc/en-us/articles/4418310927892 Neil ------------------------------ Neil Schneider ------------------------------ Re: Using the RESTful Quickbase API inside a code page without a Auth TokenYou do need to use a token, but the RESTful API has a mechanism for generating a token specific to the users login. This allows you to have a single token that is used by all users on startup, and then generate a token specific to the user and table. This has two advantages: 1) Updates to the DB are assigned to the specific user 2) The rate limits for API calls are based on the individual user. There is additional overhead for the code. The generated token is for the individual table and the user, and it expires every 5 minutes. So you have to refresh the tokens every 5 minutes. The instructions are here: https://developer.quickbase.com/operation/getTempTokenDBID ------------------------------ Neil Schneider ------------------------------ Re: Find position of text string in larger stringJonathan, I probably misunderstood the question. The formula field would return the actual value if the value is found in the string. The example returns "V23-4072", did you need the index of the value? ------------------------------ Neil Schneider ------------------------------ Re: Find position of text string in larger stringIf you only want to know if the summary field contains the value you are looking for (and don't need the index in the array), this should do it.. var text data = "V102-136 ; V23-4072 ; V8-25"; var textList dataList = Split($data, ";"); var text field = "V23-4072"; var bool hasField = Contains($dataList, $field); If ($hasField, $field, "notfound") ------------------------------ Neil Schneider ------------------------------ Re: Uncaught TypeError: JSON.Stringify is not a functionNo problem. If you're doing a lot of testing you might want to take a look at Postman, it lets you set up and test an API without any coding... ------------------------------ Neil Schneider ------------------------------ Re: Uncaught TypeError: JSON.Stringify is not a functionChris, The length needs to be the length of the string created by JSON.stringify. Try this: var body = {"from":"{XXXXXXXX}","select":[20,22,23,24,25,29,31,33],"where":"{'6'.Ex.'Yes'}AND{'20'.Ex.'New York'}"}; var bodyToSend = JSON.stringify(body); .... 'Content-Length' : bodyToSend.length ... data: bodyToSend ------------------------------ Neil Schneider ------------------------------ Re: Uncaught TypeError: JSON.Stringify is not a functionChris, Did you add the Content-Length header? You'll get an error 400 if that header isn't present. Also I'm assuming you are replacing the curly bracket enclosed items with the actual values, for example: 'QB-Realm-Hostname': yoursite.quickbase.com 'Authorization': 'QB-USER-TOKEN xxxxxx_xxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx', -where xxx... is a token for your app "from": "XXXXXXXXX", - where XXX... is the internal table name Neil Neil ------------------------------ Neil Schneider ------------------------------ Re: Uncaught TypeError: JSON.Stringify is not a functionChristopher, Two problems - it's JSON.stringify (no caps) Also you need to add a content-length header (value is the length of the stringified body) Neil ------------------------------ Neil Schneider ------------------------------ Re: Documenting settings via APIRyan, The new api returns all of the properties the old api provides, plus it includes a field by field summary of permissions on the field. Also it's much easier to use. Here's a direct link to the endpoint documentation. https://developer.quickbase.com/operation/getFields Neil ------------------------------ Neil Schneider ------------------------------ Re: URL Encoding JavascriptAdis, The syntax error is an issue, but I believe you're looking for encodeURI if this is javascript. It's documented here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI ------------------------------ Neil Schneider ------------------------------