ContributionsMost RecentMost LikesSolutionsRe: API call to put text in a multi-line text field I got it figured out. Thanks all. ------------------------------ William Hunter ------------------------------ API call to put text in a multi-line text field How via an external API call do I have to format data for a multi-line text entry field in Quickbase? I have properly obtained the JSON data but I cannot figure out how to properly format it to put it back in another multi-line text field. This is how the data looks, but it gives me an error each time I try to place it in the field. "Status: |incomplete\r\n\r\nTroubleshooting steps: |arrived onsite to troubleshoot the connection between a wall plate port and a pharmacy pc. port ph19 is not live. tried 2 patch cables neither worked. plugged pc into port ph 18 and the pc worked. i went back to the switch in the bathroom and traced thevcable from the patch panel to the switch fir ph19 and it was dead. tried a new patch cable, nothing. at this point the pharmacist told me that they were remodeling the pharmacy and there were guys running up in the ceiling and thay is when this problem started. im sure the cable was damaged in the ceiling and a new homerun cable needs ran from port ph19 to the switch inbthe bathroom of the pharmacy.\r\n\r\nMOD Name: |\r\n\r\nCheck-In: |5.00\r\n\r\nCheck Out: |6.15\r\n\r\nDelays on site: |\r" The error I am getting makes it appear as if its a formating issue, and here is the error: Failure on {"message":"Invalid Input","description":"Expected ',' or '}' after property value in JSON at position 336"} and here is my API call: CHANGE_URL="https://api.quickbase.com/v1/records" # Construct the JSON data for the edit status_data='{ "to": "bpq4irp4i", "data": [ { "3": { "value": "206722" }, "52": { "value": "'"${escaped_notes_escaped}"'" } } ] }' # Make the API call using cURL HTTP_STATUS8=$(curl -s -X POST "${HEADERS[@]}" -d "${status_data}" -w "%{http_code}" -o new_response.txt "${CHANGE_URL}") RESPONSE8=$(cat new_response.txt) rm new_response.txt if [[ ! ($HTTP_STATUS8 -ge 200 && $HTTP_STATUS8 -lt 300) ]]; then echo "Failure on ${RESPONSE8}" fi ------------------------------ William Hunter ------------------------------ Re: API HELP Mark, Yes I believe I was mixing it up also. I got it all figured out now though. Thank you! ------------------------------ William Hunter ------------------------------ Re: API HELP So, essentially if I am understanding correctly the API_GenAddRecordForm has the ability to pass information to lookup/reference fields, but external API calls do not? Because fields 8,16, and 17 that the button fills are all reference or lookup fields. This is my essentially my only overall question, is there a way like with the API_GenAddRecordForm, utilized in the button, I can pass data to the reference fields with an external API call? ------------------------------ William Hunter ------------------------------ Javascript clock in Struggling just a big here. So I made a javascript codepage for clock in/out, but when I am trying to pass certain parameters in the clock in section of the code it will only let me pass them as a text, although, they are date/time fields or related record fields. Could someone assist me in the formatting here? Code Page: function showModalMessage(message, title, url) { $('#modalmessage').empty(); $('#modaltitle').empty(); if (title === undefined || title === null) { title = 'Alert!'; } $('#modaltitle').append(title); $('#modalmessage').append('<p>' + message + '</p>'); $('#mymodal').modal('show'); $('#closediv').click(function() { window.location.href = url; }); } function closeModalMessage() { $('#mymodal').modal('hide'); } var fieldValue = function(field) { return $(field[0]).text(); }; $.when( $.getScript('?a=dbpage&pageid=13') ).done(function() { $.quickbase.api('API_DoQuery', { dbid: dbids._DBID_TIME_ENTRIES, query: '{171.EX.1}AND{172.EX.1}', clist: '3.174', slist: '3', fmt: 'structured', promise: true }).then(function(data) { if ($('errcode', data).text() === '0') { if ($('record', data).length > 1) { window.location.href = URLRoot + dbids._DBID_TIME_ENTRIES + '?a=q&qid=83'; } else if ($('record', data).length === 1) { let rid = fieldValue($('f[id=3]', $('record', data)[0])); let curTime = fieldValue($('f[id=174]', $('record', data)[0])); //console.log(rid); //console.log(curTime); $.quickbase.api('API_ImportFromCSV', { dbid: dbids._DBID_TIME_ENTRIES, records_csv: rid + ',' + curTime, clist: '3.15', promise: true }).then(function(data) { if ($('errcode', data).text() === '0') { $('#mymodal').modal('show'); //sorryDialog('You have successfully clocked out at ' + curTime, 'Clocked Out', URLRoot + appID); showModalMessage('You have successfully clocked out at ' + curTime, 'Clocked Out', URLRoot + appID) } else { showModalMessage('There was an error trying to process your request: <BR>' + $('errdetail', data).text(), 'Error', URLRoot + appID); } }); } else { //sorryDialog('You have successfully clocked in', 'Clocked In', URLRoot + dbids._DBID_TIME_ENTRIES + '?a=API_AddRecord&apptoken=' + token + '&rdr=' + URLRoot + appID); $.quickbase.api('API_AddRecord', { dbid: dbids._DBID_TIME_ENTRIES, field: [ { fid: 25, value: 'Work' }, { fid: 16, value: 'In' // This will set FID 7 to the current date/time value }, { fid: 125, value: '1' }, { fid: 13, value: rid.toString() } ], promise: true }).then(function(data) { if ($('errcode', data).text() === '0') { showModalMessage('You have successfully clocked in', 'Clocked In', URLRoot + appID) } else { showModalMessage('There was an error trying to process your request: <BR>' + $('errdetail', data).text(), 'Error', URLRoot + appID) } }); //showModalMessage('You have successfully clocked in', 'Clocked In', URLRoot + dbids._DBID_TIME_ENTRIES + '?a=API_AddRecord&apptoken=' + token + '&rdr=' + URLRoot + appID) } } else { console.log($('errdetail', data).text(), 'Data Retrieval Error', 'false'); } }); Issue Area: }); ------------------------------ William Hunter ------------------------------ Re: Dynamically filter list Negative, I certainly should have added some more information in there though. I mean for a formula-user-list field. Please see the attached photos, but I want to make it filter itself by foreman and supervisors, a role I have added to the user, dynamically so we do not have add/remove reps as they come and go. Is this possible? ------------------------------ William Hunter ------------------------------ Dynamically filter list I feel I may have seen this on here before, but I can not recall where. Is it possible to dynamically filter a list? For example if I only want to see foreman in a list, is this possible. If so how? ------------------------------ William Hunter ------------------------------ default for filter Okay, so this one is very basic, but I don't know if this is something that is in anyway native to QB. However, we have a dashboard, which can be seen below, with a filter on it. We will have multiple in field users utilizing this app, so the question is, is it possible to make a default in the filter of the last job accessed by each user. To be more clear if user 1 clocks in on job 4 last and user 2 clocks in on job 1 last, is it possible to make both of those user's filters default to jobs 4 and 1 respectively? ------------------------------ William Hunter ------------------------------ Re: Passing data in a code page Okay excellent got it thank you! I forgot one line of code. ------------------------------ William Hunter ------------------------------ Re: Passing data in a code page Perfect. I will take a look here. Thank you. ------------------------------ William Hunter ------------------------------