Help

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

Solved
Jump to Solution
1546 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Carlos_Seguin-L
5 - Automation Enthusiast
5 - Automation Enthusiast

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.

1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

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

See Solution in Thread

4 Replies 4
TheTimeSavingCo
18 - Pluto
18 - Pluto

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

Carlos_Seguin-L
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks again @Adam_TheTimeSavingCo, it worked beautifully

@Adam_TheTimeSavingCo I think that it’s fantastic that you love creating sample bases for people! I love that!! :grinning_face_with_big_eyes: 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! :smiling_face_with_halo:

Thanks again! :grinning_face_with_big_eyes:

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