Title: table row based on imported data
Last modified: April 11, 2019

---

# table row based on imported data

 *  Resolved [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/)
 * Hi there,
    first of all: great plugin! I like it very much!
 * My issue:
 * I want to sort a table based on values in a column.
    But these values get imported
   from google sheet API (shortcode) like: [get_sheet_value location=”Sheet1!B3″].
   Tablepress does not extract the value for row order.
 * Things I have tried and have not worked:
 * tablepress single cell shortcode plugin. When referring to another cell, the 
   row order deos not extract the value for sorting.
 * Any ideas how to solve this / some workaround?
 * Thank you!

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11416388)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Unfortunately, you can not use the Table Row Order Extension with data that from
   dynamic sources, like Shortcodes. Your best chance is to use the JavaScript-based
   sorting. Can you please post a link to the page with the table where this problem
   happens, so that I can take a direct look? Thanks!
 * Regards,
    Tobias
 *  Thread Starter [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11417398)
 * Thanks Tobias,
 * [https://www.lukasbydzovsky.com/test/](https://www.lukasbydzovsky.com/test/)
 * I want to order the rows based on the 24h vol.
    In the last row are the (reversed)
   ranks I put in manually.
 * I want to pull the ranks also from a google sheet and then order the rows automatically
   🙂
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11418653)
 * Hi,
 * thanks for the link! In order to be able to sort by that currency value, we’d
   need that to stand by itself in its own column (because the sorting algorithm
   can’t pick it up otherwise). Could you maybe add an extra/new column to the table
   where you only add that currency value (via that Shortcode)? We’ll then configure
   the sorting for that and hide the column again.
 * Regards,
    Tobias
 *  Thread Starter [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11418796)
 * I have now added the values in the next column. I can’t find a way to order the
   rows by those values. The arrows do not work.
 * Sincerly,
    Lukas
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11420004)
 * Hi Lukas,
 * great! Now please
    – turn on the “Use DataTables” and “Sorting” checkboxes on
   the table’s “Edit” screen (to other features can be turned off if you don’t want
   them). – Add this to the “Custom Commands” text field on the table’s “Edit” screen:
 *     ```
       "columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3 ] }, { "visible": false, "targets": [ 3 ] }, { "orderData": [ 3 ], "targets": [ 2 ] } ], "order": [ 
       [ 2, "desc" ] ]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11420222)
 * Thank you very much!
    This works but
 * – I dont want to display a table header row and enable sorting by visitors.
    –
   it now shows only the values while hiding the currency value (which I want to
   be displayed)
 * Any way how to remove it? Do you accept bitcoin for donation?
 * regards,
    lukas
    -  This reply was modified 7 years, 1 month ago by [onetime1a](https://wordpress.org/support/users/onetime1a/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11420325)
 * Hi,
 * ah, my code has a small bug. Please try again with
 *     ```
       "columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3, 4, 5 ] }, { "visible": false, "targets": [ 5 ] }, { "orderData": [ 5 ], "targets": [ 3 ] } ], "order": [ [ 3, "desc" ] ]
       ```
   
 * In addition, please add a new (empty) first row to your table.
 * Then, please also add this to the “Custom CSS” textarea on the “Plugin Options”
   screen of TablePress:
 *     ```
       .tablepress-id-11 thead {
         display: none;
       }
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11420460)
 * thank you for taking the time – everything works, just sent some BTC.
    [https://btc.com/fded4587b544ae5e88e06c155cfe8736d6cc8fe40c3e89c2198fffa3a466d4b0](https://btc.com/fded4587b544ae5e88e06c155cfe8736d6cc8fe40c3e89c2198fffa3a466d4b0)
 * coffee is on me 😎
 * Sincerely,
    lukas
    -  This reply was modified 7 years, 1 month ago by [onetime1a](https://wordpress.org/support/users/onetime1a/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11420904)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * And thanks for the coffee, I really appreciate it!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!
 *  Thread Starter [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11421203)
 * sry, I thought it worked, but it doesn’t.
    I applied all the commands and checkmarked“
   data tables” and “sorting” Any idea ?
 *     ```
       "columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3, 4, 5 ] }, { "visible": false, "targets": [ 5 ] }, { "orderData": [ 5 ], "targets": [ 3 ] } ], "order": [ [ 3, "desc" ] ]
       [ 2, "desc" ] ] 
       ```
   
 * There are 6 columns and 9 rows.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11421222)
 * Hi,
 * okay, another try:
 *     ```
       "columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3, 4 ] }, { "visible": false, "targets": [ 4 ] }, { "orderData": [ 4 ], "targets": [ 3 ] } ], "order": [ [ 3, "desc" ] ]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11421418)
 * nope 😀 I have applied it, but look yourself.
    I guess its because of it cant
   grab data from a shortcode ? 🙁
 * regards,
    Lukas
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11421449)
 * Hi,
 * please check the “Custom Commands” field again, it seems that you have a line
   break in the code now, so that some code is in there twice. (You can drag the
   field bigger in the lower right corner.)
 * Regards,
    Tobias
 *  Thread Starter [onetime1a](https://wordpress.org/support/users/onetime1a/)
 * (@onetime1a)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11422791)
 * 👍🏼
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11422834)
 * Hi,
 * Good to hear that it’s working now! 🙂
 * Best wishes,
    Tobias

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘table row based on imported data’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 15 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/table-row-based-on-imported-data/#post-11422834)
 * Status: resolved