Forum Discussion
CDMAutomation
3 years agoQrew Member
You can do something like this which is a slimmed-down version of your code
var customRedirectURL = "https://xxxxxxx-xxxxxxx.quickbase.com/db/xxxxxxxxx?a=dbpage&pageID=2" + "&rid=" + $(data).find('rid').text() + "&AnotherVariable=" + $(data).find('XPathToXmlNode').text();
console.log(customRedirectURL);
window.location.href = customRedirectURL;
With JQuery, you can text from XML, for a given node, XML node using the this method:
$(data).find('[XPath]').text()
Where $(data) is the API response XML
------------------------------
CDM Automation
------------------------------
- LijaHarris3 years agoQrew CadetThank you so much for your reply!!! So, let's say I want to make _fid_23 that variable, or maybe im mis-speaking. Ideally in a perfect world, I want a field's value at the end of the customRedirectURL. So currently the above gives me a final redirect url of (The "X" are placeholders): https://XXXXXXXXXXXXXX.quickbase.com/db/XXXXXXXXX?a=dbpage&pageID=2&rid=72
Instead of rid = 72 which is giving back the record id that was created by the user, I would like record 72's field's value for field 23. So lets say field 23 is a text-formla field that is ="C-"&[Record ID#]. I would like https://XXXXXXXXXXXXXX.quickbase.com/db/XXXXXXXXX?a=dbpage&pageID=2&rid=C-72 instead.
------------------------------
Lija Harris
------------------------------ - LijaHarris3 years agoQrew CadetSorry, i meant that i would like https://XXXXXXXXXXXXXX.quickbase.com/db/XXXXXXXXX?a=dbpage&pageID=2&VARIABLE=C-72 instead...in case that makes more sense because i dont need the rid at all, just the formula-text field's value from that record.
------------------------------
Lija Harris
------------------------------- SimonH3 years agoQrew CadetAPI_AddRecord does not return other fields so you won't be able to use another field unless you make a separate request to get that records details using the newly generated rid
------------------------------
Simon H
------------------------------