<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" width="40px" /> This example database contains some file attachments. The Meta formula property displays information about each file, including its media type and hosting location (within Notion or hosted externally).

Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter

</aside>

Media Info

// Compressed
if(test(prop("File"),"([jJ][pP][eE]?[gG]|[gG][iI][fF]|[pP][nN][gG])"),"🌅 Image",if(test(prop("File"),"([mM][pP]3|[wW][aA][vV]|[aA][iI][fF]{2})"),"🎧 Audio","📝 Text")) + "\\n" + if(test(prop("File"),"secure.notion-static.com"),"✅ Internal","⛔️ Externally Hosted")

// Expanded
if(
    test(
        prop("File"),
        "([jJ][pP][eE]?[gG]|[gG][iI][fF]|[pP][nN][gG])"
    ),
    "🌅 Image",
    if(
        test(
            prop("File"),
            "([mM][pP]3|[wW][aA][vV]|[aA][iI][fF]{2})"
        ),
        "🎧 Audio",
        "📝 Text"
    )
) + 
"\\n" + 
if(
    test(
        prop("File"),
        "secure.notion-static.com"
    ),
    "✅ Internal",
    "⛔️ Externally Hosted"
)

© Thomas Frank