May 22, 2023 01:41 AM
Hi there
I am hoping you can help me.
I need to automate Clinician Fees in Airtable according to the Insurance company and whether the patient is a clinic (default fee) or practitioner's own patient (unique).
Will it be easier to do an Automation or Formula and how would you do that?
Thanking you in advance for the help.
Solved! Go to Solution.
May 22, 2023 07:43 AM
Hi,
I would use a formula.
IF({Company1 Own Patient},{Company1 Own Patient},
IF(Company2 OwnPatient},{Company2 ....
and so on, depending on the priority of fields
You can write smarter and shorter solutions depending on decision logic, for example if you know that only one 'Own patient' filled, you can get a result as
IF(CONCATENATE({Field1}, {Field2} ... etc), CONCATENATE({Field1}, {Field2} ... etc),
IF(
Also, you can use this mini-script to get a table of field names, divided by 'Own/ not own', paste it in temporary table and use a formula to create a formula ))
const own=name=>name.includes('Own')
const flds=base.getTable(cursor.activeTableId||'').fields.map(f=>f.name.toString()).sort()
output.text([...flds.filter(own),...flds.filter(n=>!own(n))].join('\n'))
May 22, 2023 07:43 AM
Hi,
I would use a formula.
IF({Company1 Own Patient},{Company1 Own Patient},
IF(Company2 OwnPatient},{Company2 ....
and so on, depending on the priority of fields
You can write smarter and shorter solutions depending on decision logic, for example if you know that only one 'Own patient' filled, you can get a result as
IF(CONCATENATE({Field1}, {Field2} ... etc), CONCATENATE({Field1}, {Field2} ... etc),
IF(
Also, you can use this mini-script to get a table of field names, divided by 'Own/ not own', paste it in temporary table and use a formula to create a formula ))
const own=name=>name.includes('Own')
const flds=base.getTable(cursor.activeTableId||'').fields.map(f=>f.name.toString()).sort()
output.text([...flds.filter(own),...flds.filter(n=>!own(n))].join('\n'))
Jun 06, 2023 12:56 AM
Thank you very much 🙂