Read a file extension from Attachment filed to set its type in a different field

Hi team again, I need a quick hand, block with this atm

In a table I have the following to fields

  • File - Attachment : It could be an image, gif, video or audio
  • Type - Multiple Select: Details de type of the image based on manually set options (image, gif, video or audio)

Any ideas on how to set the Type based on File extension?

If you’re wondering, the Type field will be used in a user facing filter to search by file types.

Hey Carlos, check this out

Screenshot 2022-08-03 at 7.13.10 PM

Works by extracting the file extension and then using a SWITCH() to get the type. You’ll have to manually populate the switch, but other than that you should be good to go I reckon

2 Likes

Thanks again @Adam_TheTimeSavingCo, it worked beautifully

1 Like

@Adam_TheTimeSavingCo I think that it’s fantastic that you love creating sample bases for people! I love that!! :smiley: That’s really incredibly kind of you to volunteer your time to do that for people!! :star_struck: :raised_hands:

I think you should continue creating sample bases for people if you would like to do so, but I’d also like to make a suggestion to please list your formulas here in the forums here as well, which would likely be the most helpful way for current & future users to learn.

That’s because (a) there is no guarantee that your bases will always be accessible in the future, and (b) it requires extra steps for a user to connect to your base and then duplicate it into their own workspace. So having the formulas listed here can make for a quicker & more permanent learning experience for users.

Just a suggestion — you don’t need to take it, if you don’t want to! :innocent:

Thanks again! :smiley:

2 Likes

That’s true, I’ll definitely try to do that, thanks!

2 Likes

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.