May 23, 2022 08:09 AM
Hi, I’d like to create a field that automatically fills in only some of the data from a multiple select field.
For example, I have a field that records whether a therapy is long term/short term; and sometimes includes how many weeks long the therapy is.
I’d like another field to automatically pull in the long/short term info but to not also include how many weeks long the therapy is.
Thanks in advance!
May 23, 2022 08:44 AM
Hi again Y_S!
Try this out in a formula field:
IF(
AND(
FIND("Long", {Length of Therapy}),
FIND("Short", {Length of Therapy})
),
"Long and Short",
IF(
FIND("Long", {Length of Therapy}),
"Long",
IF(
FIND("Short", {Length of Therapy}),
"Short",
""
)
)
)
Result:
May 23, 2022 08:58 AM
Thanks - is there a way to do it so that they are separate snippets of data (ideally as a label similar to the multiple select) rather than as a string?
May 23, 2022 09:06 AM
Hmm, like with the colors and everything? Unfortunately, I don’t think so.
We could do an automation that pastes the string into a multi select field where you’ve got the colors set up maybe?
May 23, 2022 09:19 AM
Hmm
This is what I’m trying so far - how would you suggest I set up this automation?
May 23, 2022 08:28 PM
May 24, 2022 03:14 AM
Hmm I’m getting an error message when I do this
Any suggestions?
May 24, 2022 05:45 AM
Hm, your record ID input’s set up wrong in that picture. Here’s how it should be set up:
And here’s my base setup
You can also view the automation details in this base I’ve set up for you
May 24, 2022 06:32 AM
The ideas from @Adam_TheTimeSavingCo certainly work, but I want to suggest a different approach. It seems that the question of “short” vs “long” – what I’ll call Term Length Category – and the number of weeks/months are different types of information and should therefore be in different fields. One of the tenets of DB design is that every different type of information should be separate.
This is a similar situation to something I have at work – we produce multiple types of written products, each of which has attributes which need to be in the product’s record. Based on that experience, I suggest:
concatenate({Term Category},if({Therapy Length}," - " & ({Therapy Length}))
Link Your Existing table to Therapy Terms and allow multiple selection of Terms.
In your existing table, create two lookup fiends - one for Term Category and One for Term Length.
The result:
This also has the additional benefit of giving you the ability to have other ‘attributes’ that a type of therapy can have and show in the main record.