Plugin to mimic Composite Field from 2 fields using if logic

Hi All

I tried create a composite field from 2 date fields lets call them Date Created and Date Verified where the logic is

If the Date Verified is more recent than the Date Created then use the Date Verified.
If the Date Verified doesn’t have a value then use the Date Created.
There will always be a Date Created.
Date Verified should be in theory more recent but i would prefer to check that it is :slight_smile:

I got the impression that this wasn’t possible so i followed the instructions in

So I Created a New Field to store the pseudo “Composite Field”. Called Newly Registered date.

In Code studio when into references and add references etc.

When I came to write the code i could not work out how to get the values of the attributes and properties of the record.

const caseRecord = mats.record(params.record_id); // Gets the id of the record

but how do you get the other ones?

Also the Date created is a Timestamp so do i convert that to a date.

Any help pointers etc would be appreciated

Kind Regards

Steve W.

Hi Steve,

Welcome to the community.

You can use subsets within composites to provide if then logic.
Create a subset for when Date Verified is greater than Date Created.
Use this in your composite to create an If block and show Date Verified, use the inverse of this subset to then show Date Created.

Hope this helps.