I am passing a variable to the table using %VAR1%. This variable is used in a query but I also need to use it in a link I create in one of the columns. I am using the menu Transform Value, all works great except I can't get this variable in. Is there a way to do this?
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
-
I am sorry, but i am not sure i understood exactly how you are trying to insert a VAR1 Placeholder as part of the Transform Value.
Could you please show me some screenshots what you tried to achieve;
and if you can also elaborate in more details?
-
If you are trying to insert it directly in a cell anywhere in a Table, including as part of the "Transform Value" Sting Column, that can not work.
The 'VAR' Placeholders can only be used either directly in your SQL Query for a Table, or as pre-defined Text Filter in the Column settings.
But, I did not understand what you described exactly, so if you could show me more details, and we will advise if that is possible?
The best will be if you can record a Video of your Screen.
If it has any sensitive data, just send it as a PRIVATE reply for safety - and if it gets too large, you can upload it to weTransfer and send a download link.
In the meantime I have solved it with an SQL query.
However, there is another issue I run into with using the placeholders. I use it to determine the MySQL table it should take select. Then I want to make that table editable, however I can't do it as the query that sets the value does not recognize the %VAR1%. Which is a real shame, is it possible to make it so that the placeholder can be used in the "My SQL table name for editing" field (see attachments)? Without knowing the structure of your software and its limitations, it seems like an easy thing to implement and it would enable much functionality for our implementation.
It is not possible to set the VAR placeholder as part of the Table name either in the Select statement in the Query or in the MySQL Table name for editing.
We need to give the table an actual existing table name from the database so that our plugin can generate the table.
Also when it comes to editing limitations, for example if you use an SQL JOIN to merge data from multiple tables, you won't be able to edit it, because our Plugin can only edit one table at a time.
So the table where we pull the data from can only save the editing in the same table, if that makes sense ;
In other words, we can not pull data from SQL table A, and save editing to Table B etc.
Sorry to disappoint you, but at this time, we don't have any built-in solution to achieve this
You can suggest it to our developers, though - they will do their best to make a solution in the future.
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
-
If you have coding skills and wish to try to make a custom solution now,
Please be advised that custom solutions with hooks are not included in our support.
You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.
( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)
I found one example, it is a different use case, but it is a custom idea how you could try having a dynamic SQL Query which can be changed via API call or PHP.
You can take a look at our available filters for developers here ;
but combining these two or perhaps even just by using that hook/filter,
you might be able to achieve this use-case.
We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet, so at this time you can only try to make a custom solution to make this work.
I don't understand your first remark, I have created MySQL queries in your plugin with %VAR1% in the table name and that works just fine with a SELECT statement. That is why I suggest to make it possible to have the %VAR1% in the editable table parameter.
I do use a JOIN, I would think that as long as the variable I want to edit are not in both tables that would not be a problem for editing. But even if your plugin would work without a JOIN as described above and without the JOIN, we could build our app around it.
I do have coding skills but currently not the time to dive into this here, I hope your plugin will provide such a feature in the future.
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
-
1. You said you managed to create MySQL Queries in our Plugin with %VAR1% in the Table Name and that works with the SELECT Statement.
Maybe we did not try a specific way like you did yet.
Could you please show me some screenshots, send me your Query and if possible, record a Video of your Screen where you managed to achieve that generating a Table on the back-end?
2. When it comes to having the VAR1 in the Editable table parameter, in terms of the "MySQL Table for Editing";
As i mentioned, our Plugin is not designed to be used in this way, so we are not able to make it work.
For our editing feature, as mentioned on our Documentation for Editing, under the limitations, it explains how we can only edit one Table at a time, so if you call data from multiple Tables, that won't work, as well.
When it comes to JOINS : When you are using JOINS with more tables please note that in wpdatatables just one table can be editable at the moment and that is the reason why you can't edit fields in table that you made from two tables.
Or, if you have an SQL VIEW, that can also not be made editable.
Or, if you have an SQL CONCAT, that Column can't be edited, since it is a custom made Column, not an actual existing one.
Also, when editing, please avoid using an ALIAS name, use the actual SQL Column name from the source Data to avoid editing issues.
That's it when it comes to built-in editing options and using VAR1 as part of the Table Name, or MySQL Editing Name, but of course, you are free to experiment or try to customize it if you have coding skills, just our Support is not able to cover any customizations;
and our developers are not available for custom work.
Hi,
I am passing a variable to the table using %VAR1%. This variable is used in a query but I also need to use it in a link I create in one of the columns. I am using the menu Transform Value, all works great except I can't get this variable in. Is there a way to do this?
Kind regards,
Auke
Hi Auke,
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
-
I am sorry, but i am not sure i understood exactly how you are trying to insert a VAR1 Placeholder as part of the Transform Value.
Could you please show me some screenshots what you tried to achieve;
and if you can also elaborate in more details?
-
If you are trying to insert it directly in a cell anywhere in a Table, including as part of the "Transform Value" Sting Column, that can not work.
The 'VAR' Placeholders can only be used either directly in your SQL Query for a Table, or as pre-defined Text Filter in the Column settings.
But, I did not understand what you described exactly, so if you could show me more details, and we will advise if that is possible?
The best will be if you can record a Video of your Screen.
If it has any sensitive data, just send it as a PRIVATE reply for safety - and if it gets too large, you can upload it to weTransfer and send a download link.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Miloš, yuo answered my question.
In the meantime I have solved it with an SQL query.
However, there is another issue I run into with using the placeholders. I use it to determine the MySQL table it should take select. Then I want to make that table editable, however I can't do it as the query that sets the value does not recognize the %VAR1%. Which is a real shame, is it possible to make it so that the placeholder can be used in the "My SQL table name for editing" field (see attachments)? Without knowing the structure of your software and its limitations, it seems like an easy thing to implement and it would enable much functionality for our implementation.
Kind regards,
Auke
Attached files: Schermafbeelding 2024-01-27 om 13.39.59.png
Schermafbeelding 2024-01-27 om 12.52.27.png
Hi Auke,
Apology for all the waiting time.
It is not possible to set the VAR placeholder as part of the Table name either in the Select statement in the Query or in the MySQL Table name for editing.
We need to give the table an actual existing table name from the database so that our plugin can generate the table.
Also when it comes to editing limitations, for example if you use an SQL JOIN to merge data from multiple tables, you won't be able to edit it, because our Plugin can only edit one table at a time.
So the table where we pull the data from can only save the editing in the same table, if that makes sense ;
In other words, we can not pull data from SQL table A, and save editing to Table B etc.
Sorry to disappoint you, but at this time, we don't have any built-in solution to achieve this
You can suggest it to our developers, though - they will do their best to make a solution in the future.
Please feel free to search on our suggestions page,
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
-
If you have coding skills and wish to try to make a custom solution now,
you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.
Please be advised that custom solutions with hooks are not included in our support.
You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.
( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)
I found one example, it is a different use case, but it is a custom idea how you could try having a dynamic SQL Query which can be changed via API call or PHP.
You can take a look at our available filters for developers here ;
https://wpdatatables.com/documentation/information-for-developers/filters/
-
They pointed out this one :
wpdatatables_filter_mysql_query( $query, $tableId )
because you can use that to manipulate the Query.
There is also an option with Placeholders,
but combining these two or perhaps even just by using that hook/filter,
you might be able to achieve this use-case.
We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet, so at this time you can only try to make a custom solution to make this work.
I hope this helps.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Miloš,
Thanks for your reply.
I don't understand your first remark, I have created MySQL queries in your plugin with %VAR1% in the table name and that works just fine with a SELECT statement. That is why I suggest to make it possible to have the %VAR1% in the editable table parameter.
I do use a JOIN, I would think that as long as the variable I want to edit are not in both tables that would not be a problem for editing. But even if your plugin would work without a JOIN as described above and without the JOIN, we could build our app around it.
I do have coding skills but currently not the time to dive into this here, I hope your plugin will provide such a feature in the future.
Kind regards,
Auke
Hi Auke,
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
-
1. You said you managed to create MySQL Queries in our Plugin with %VAR1% in the Table Name and that works with the SELECT Statement.
Maybe we did not try a specific way like you did yet.
Could you please show me some screenshots, send me your Query and if possible, record a Video of your Screen where you managed to achieve that generating a Table on the back-end?
2. When it comes to having the VAR1 in the Editable table parameter, in terms of the "MySQL Table for Editing";
As i mentioned, our Plugin is not designed to be used in this way, so we are not able to make it work.
For our editing feature, as mentioned on our Documentation for Editing, under the limitations, it explains how we can only edit one Table at a time, so if you call data from multiple Tables, that won't work, as well.
When it comes to JOINS :
When you are using JOINS with more tables please note that in wpdatatables just one table can be editable at the moment and that is the reason why you can't edit fields in table that you made from two tables.
Or, if you have an SQL VIEW, that can also not be made editable.
Or, if you have an SQL CONCAT, that Column can't be edited, since it is a custom made Column, not an actual existing one.
Also, when editing, please avoid using an ALIAS name, use the actual SQL Column name from the source Data to avoid editing issues.
That's it when it comes to built-in editing options and using VAR1 as part of the Table Name, or MySQL Editing Name, but of course, you are free to experiment or try to customize it if you have coding skills, just our Support is not able to cover any customizations;
and our developers are not available for custom work.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables