Forum Discussion
AmmarAl-Hadeeth
8 years agoQrew Member
I have done something like the following, which will require some coding though:
1-Create a "Text-Formula" field and allow HTML tags in it
2-Add "<img> " and have the onload() function to run a script that will run api_genResultsTable&jsa=1 query, clist for the column to be calculated and get the total in javascript.
3-Add "<p>" with an ID that have the record ID composed in it so you can use in it a report
4-Return the calculated value in that <p> tag
The only downside is that you cannot export result, it will show as script in the CSV file. But it is good to study and check visually.
1-Create a "Text-Formula" field and allow HTML tags in it
2-Add "<img> " and have the onload() function to run a script that will run api_genResultsTable&jsa=1 query, clist for the column to be calculated and get the total in javascript.
3-Add "<p>" with an ID that have the record ID composed in it so you can use in it a report
4-Return the calculated value in that <p> tag
The only downside is that you cannot export result, it will show as script in the CSV file. But it is good to study and check visually.
- JacobJacob8 years agoQrew CadetHello,
I am trying to do something similar. Essentially I am trying to get a summary field without a relationship. I have some coding skills and I am proficient with quick base api's but could you possibly provide some more information on how to do this? - AmmarAl-Hadeeth8 years agoQrew MemberYes sir, are you familiar with the onload technique ??
-Add a text-formula filed.
-Allow some HTML code
-Add "<img src='[any image url, required]' hidden onload='javascript: alert("OK")'>"
-Try this, if it alerted "OK" then you can replace the alert function with a function that will search and calculate total using api_genResultsTable
Let me know if you need more clarification - JacobJacob8 years agoQrew CadetGreat. I got the alert popup to work. I am not sure how to calculate the total with the API_genresultstable? Possible to provide some color on that as well?
- AmmarAl-Hadeeth8 years agoQrew MemberYou can return a javascript array with the field you want to sum using the api_GenResultsTable, and then calculate the total and return it. Below link might be helpful, You can use something like:
<img ....><p id='x"&[Record ID#]&"'>Loading ... </p>
So you can use the field in a report, but please remember, the results will not be exportable.
https://help.quickbase.com/api-guide/gen_results_table.html
Please let me know if you need more clarification
Regards - GauravSharma38 years agoQrew CommanderHi Aiden,
I have a similar need to calculate the total hours logged for a day. - AmmarAl-Hadeeth8 years agoQrew MemberHave you tried to get the alert mentioned in my first comment?
- GauravSharma38 years agoQrew CommanderYes, it's done.
- AmmarAl-Hadeeth8 years agoQrew MemberAre familiar with "API_GenResultsTable" call? It can return a javascript Array with values that you need them totaled!
Regards