Grooper 21.00.0082 is available as of 12-12-2023! Check the  Downloads Discussion  for the release notes and to get the latest version.
Grooper 23.00.0042 is available as of 03-22-2024! Check the Downloads Discussion for the release notes and to get the latest version.
Grooper 23.1.0018 is available as of 04-15-2024! Check the  Downloads Discussion  for the release notes and to get the latest version.
Options

Question regarding Parsing information from a Folder Name to Populate a Field

I have a default value expression that currently Grabs the folder name on Import to populate a certain field. The default expression is this:
Link.GetPathSegment(7)

This gets me the 7th segment in the import path. Is there a way to parse a certain piece out of this segment?

Best Answer

  • Options
    tmartintmartin Posts: 82 ✭✭
    Answer ✓
    I spoke to several people regarding this question and came to the following solution:

    I used a calculate expression that references the field that is grabbing the folder name. 

    The structure of the folder name is:
    "Name" "4-Digit License Number" - "8-Digit Date"
    Ex: Martin, Trey 1234 - 20180525
     
    The Calculate Expression is as follows:
     Licensee_Name.Substring(0,Licensee_Name.Length-16)

    Note: "Licensee_Name" in the expression above is the field in the content model that is grabbing the entire folder name.

Answers

  • Options
    GrooperGuruGrooperGuru Posts: 481 admin
    Yep, substring should be a good method for this use case. However, if it needed to be more dynamic, a regular expression could possibly be implemented here via .Net. I don't know the syntax though. I'm spoiled by Grooper handling that kind of thing for me. I know RegularExpression itself, but now how to access it via .Net.
    Matt Harrison
    Product Manager
    mharrison@bisok.com
Sign In or Register to comment.