Jump to content

Suggested Feature - Field Mapper


Adam

Recommended Posts

I'd like to suggest a field mapping feature. Here's the idea:

 

I have a lot of clients who will submit a new list after they see a proof. Also, we get a fair amount of "repeat with new list" jobs. Often times, the client will either have fields with slightly different names, or be missing a field altogether. This can be a real pain to deal with on a large, complex job.

 

I'd like to have a utility that runs when you do "Change Input File" that checks for all fields used (including those used in rules), informs you if any are missing in the new list, and allows you to map fields with different names to those that are missing.

 

It would certainly make my life easier. Who's with me?

Link to comment
Share on other sites

I have a client like that, changing the headers all the time or adding headers I don't even need. Repeat campaign also.

 

The data file that I input to my mailing software is always the same. I have to clean-up their lists and take what I need and paste it into the "master" data file.

Do you have any automated features in your mailing program to eliminate manual processes?

 

I like the idea of being able to add new column headers to an existing RULE, on the fly to an existing campaign but I could see how it could also become un-organized on my part. If the data file is constantly coming in wrong with unique column headers and I have to constantly edit my FusionPro campaign(add rules, match headers, etc....) it MAY pose a problem.

Link to comment
Share on other sites

Here was my answer to basically this same question on the old email forum:

http://www.mail-archive.com/fusionpro@printplanet.com/msg00279.html

 

Here's an updated version:

 

You have a couple of options:

 

OPTION 1: If your data fields are always in the same order, but the field names are different, you can simply uncheck the "First row contains field names" box in the Define Data Source Wizard. Then the field names are defined by the Data Fields dialog (FusionPro -> Data Definition -> Input Options -> Fields). You can always tell the composition to skip the first "record" row which contains the field names by creating an OnRecordStart rule with this syntax:

if (CurrentRecordNumber() == 1)
     FusionPro.Composition.composeThisRecord = false;

OPTION 2: You can create a function like this:

function OneOfTheseFields()
{
  var list = "";
  for (var i = 0; i < arguments.length; i++)
  {
    try
    {
      var result = Field(arguments[i]);
      Print("Found Field \"" + arguments[i] + "\", value: " + result);
      return result;
    }
    catch (e)
    {
      if (list)
        list += ", ";
      list += arguments[i];
    }
  }

  var msg = "None of the fields were found: " + list;
  if (FusionPro.inValidation)
    return msg;

  Print(msg);
  return "";
}

Then you can call this function like so:

return OneOfTheseFields("Company Name", "Company", "COMP");

You can have one instance of this one-liner function rule for each text field you're using in the job, with each rule having the same name as the field it's overriding.

 

The OneOfTheseFields function takes a variable number of arguments, or parameters, which are the field names to look for. Feel free to add as many variations as you need. It will return the value of the first valid field in the list, or, if none of the field names are valid, it will return an empty string and write a message to the log file. The function itself can either go directly inside the rule from which you are calling it, or in your JavaScript Globals. (This logic can also be extended to look for Rule values as well as Field values.)

 

 

P.S. In FusionPro 6.0 and later, you can iterate through all the field names, with the FusionPro.Fields object, like so:

for (var i in FusionPro.Fields)
    Print("Field \"" + i + "\", value: " + FusionPro.Fields[i]);

This can be useful to dump out the field names for debugging.

Link to comment
Share on other sites

Thanks, Dan.

 

I've already written rules similar to this. My point was to suggest this as a feature because I figured more than a few people might find it useful. It just feels like something that *should* be built in.

 

-Adam

Link to comment
Share on other sites

TMy point was to suggest this as a feature because I figured more than a few people might find it useful. It just feels like something that *should* be built in.

Ah, sorry, I was responding more to rpaterick's reply about using a rule.

 

Your original idea is a good one:

I'd like to have a utility that runs when you do "Change Input File" that checks for all fields used (including those used in rules), informs you if any are missing in the new list, and allows you to map fields with different names to those that are missing.

This is something we've discussed as a possible future enhancement. However, the actual implementation of this feature can quickly become very complicated, and may end up being more confusing, since the person who is doing the mapping may not know the intent of potentially two other people who designed the template and supplied the new data. This doesn't mean it's not possible to design such a UI, but we want to make sure that anything we do add is going to be intuitive.

Link to comment
Share on other sites

I'm glad you guys are considering it. You're right, though. You don't want to put something like that out there without a lot of planning. It needs to be intuitive.

 

My biggest problem with FP is that I understand it just fine, because I get programming, but it is hard to train employees that don't have that kind of background. I'm in favor of anything that can be added that will cut down on the amount of code writing.

 

-Adam

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...