Feature Request: Grid option to select method for mapping imported column headers to db column names

QuestionsFeature Request: Grid option to select method for mapping imported column headers to db column names
Michael Murphy asked 1 month ago

By default, when importing a csv file which has the names of the database columns as its header, similar_text is used to compare the header with the column names, and maps them together if they have over 80% similarity.

In this question, @AbuGhufran explains that this default can be changed so that they are only mapped if they are exactly equal. However, this can only be done by changing part of the core grid code.

There are two issues with this:

  1. Making this change may only be possible for server admins. Any regular developer will need to ask the admins to change this code for them.
  2. This change is a global setting – it makes it impossible to use the similar_text method on one page, and the “exactly equal” method on another page.

It would be much more convenient to have a grid option, like below, which would select the method to use for the mapping. Would it be possible to add this option?

$opt[“import”][“columnmapping”] = “exact”;         // the other option could be “similar”

1 Answers
Abu Ghufran Staff answered 1 month ago

Hello,

Thanks for the suggestion.

This feature was previously requested via email by a customer and added in latest build.

If you want to adjust CSV headers and database fields mapping accuracy, default: 80:

$opt[“import”][“match”] = 95;
$g->set_options($opt);

So for exact match, you can set it to 100.

Online documentation will be updated soon as well.

PS: Check your email for latest build.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

9 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?