Guide 37 – In data export, delete columns without content |
6/2/2022 4:35:58 PM |
PHPRunner Tips and Tricks | |
fhumanes author
Among the many support queries that I have and that I try to find a solution for, I got this one about wanting to eliminate the columns in the export, of those fields that do not have any information among the selected records, that is, that all their values are null. The need arose because many fields are defined in the design of its data model and there are times when many of them are empty. Objetive DEMO: https://fhumanes.com/export Technical Solution I have divided the solution into 2 parts:
The resulting code is only in the " Before SQL query " event: // Obtener la columnas que todos sus valores son nulos Perhaps this example may be of little use, but it is important to know the information of the “ selectFields ” variable of the “ pageObject ” object , which seems to be common to all PHPRunner actions/pages and that has the list of columns that are going to be displayed in the output result. As always, if you have any questions, let me know at my email fernandohumanes@gmail.com and I'll leave you the project in case you want to do tests on your PCs. |
|