Forum Discussion

DavisMichaelsen's avatar
DavisMichaelsen
Qrew Trainee
6 years ago

Highlighting a file with a specific naming convention

I am trying to highlight a file that shows up in a report with a specific naming convention. 

The naming convention is as follows: Store # - Project Type.pdf. So, an example PDF would look something like "0001-ROOF.pdf"

I am not trying to just pull one project type. There are 130 types. So I need some way to dynamically refer to the Store # and Project Type fields.

What kind of formula can I use to highlight files that follow this naming convention?

7 Replies

  • Can you explain what you mean by "highlight"  Are you looking to do Row Colorization or are you looking to have the text show up in yellow if it meets a certain format?
  • I would suggest a formula checkbox to allow the records to self identify as needing to be checked. The formula could be a "If" statement checking the checkbox if whatever condition(s) you set on the file attachement field is true. Then just set row colorization in the report settings to color the row if your newly created checkbox is checked.
  • I think that Davis is looking for help with the actual syntax of the formula for if the file naming convention is valid.  i will have to find time to respond unless someone beats me to it.
  • Not tested but try this.  I'm going to solve for flagging invalid file formats.


    // format should be "0001-ROOF.pdf"

    var text FileName = ToText([File Attachment]);

    var text ProjectNumber = Left($FileName,"-");
    var text ProjectType = Part($FileName, 2,"-");
    var text FileType = Right($FileName,".");

    IF(
    $ProjectNumber <> [Project Number]
    or
    $ProjectType <> [Project Type],
    or
    $FileType <> "pdf"), true)

    // I don't know what field type your Project Number is.
    // if its numeric then the formula would be



    IF(
    ToNumber($ProjectNumber) <> [Project Number]
    ......