Issue joining on another module's field

Hey team,

Say I have a Lead Module that has a First Name.
Then I have a Lead Status Tracker Module - which has a First Name fields, that I use Record Selector for > Selecting Lead > Selecing FirstName Fields.
It was my understanding that I should see the First Name of the Lead Module but not it is not there. First Name of the Lead Status Tracker Module lives as its own field for some reason.

Am I missing something? Or is this functionality not supported? I thought I recall being able to join this way - it works perfectly with IDs for sure.

Thanks in advance!



It depends on what you are trying to achieve.

If you merely want to display the First name of the Lead as a text field in LeadStatusTracker module, you could populate it via a beforeCreate or beforeUpdate workflow on the LeadStatusTracker module … you would simply lookup the Lead using using a function and paste the First Name into the record.

Using 2 x Record Selectors pointing to Leads should work fine, but both “lookups” are pointing to the same record - you can display different field names, but underneath it is just the same recordID.

If I understand correctly, you’re trying to achieve sort of view functionality with JOIN like you would in SQL - someting like:
Select Lead.FirstName, LeadStatusTracker.* from LeadStatusTracker
join Lead on Lead.FirstName = LeadStatusTracker.FirstName

This functionality you’re using here is not like that. It allows you to join the record from separate table (module) later, using another module as a list of possible values as opposed of hard-coding the optins to select.

Thanks for the response, Mark.
I assumed since it is joined by id - you get access to all the fields this module has, which would be great, and eliminated the need to any extra moves to get there.

Using 2 x Record Selectors pointing to Leads should work fine
Could you elaborate on this / or help me understand what you mean here?

From what I understood - there is a way to accomplish what I am trying to do using workflow and events. But while there is a way to join another module on record Id and display that record Id field - there is not a way to display this (joined module’s) field based on the fact that you know its ID.

Basically, you can get the RecordID as a result of that join, but not other fields, right?

PS: By the way, if anyone could point me in the right direction on what it would take to implement this as a feature, what are the potential implications of getting all the field values? That seems like a cool and helpful functionality that could be utilized. I would be happy to find time to work on this feature. I will dig in and see what it takes - any gotchas, needs to knows are welcome though since I am relatively new to Corteza.

Almost.

Say I have a Lead Module
RecordID: 123
FirstName: John

Then say I have a LeadStatusTracker
RecordID: 999
LeadID: // RecordSelector of the lead
Status: Prospect
DateUpdated: Dec 15, 2023

So the goal of the LeadStatusTracker is to track status changes of the lead.

  • Visitor Filled Out The Contact Form - the LeadStatusTracker will have a record of this.
  • You spoke on the phone and sent a confirmation email to confirm the job - record is added that says on Dec X, XX - lead became a client… Basically a Lead Status Tracker so you can see when it changed (as opposed to just change the status field on the lead - that will work but then you don’t have a clear way to track status changes)

In the Lead Status Tracker I want to to add a Lead’s First Name So You Can better Identify the Lead when you looking at Status changes record. and I thought if I add a field on the LeadStatusTracker, called FirstNameThatIExpectToComeFromLead - and I pick record selector and in the field drop down I select FirstName - I thought now this FirstNameThatIExpectToComeFromLead knows to get the value from Leads.FirstName but turns out it does work this way.

My goal was to make it so say a John name on the Lead module changes to Johnatan - with this setup, since I am referencing this filed from Lead.FirstName - when looking at the Lead Status Tracker records I can now see the new name. I could duplicate this field but then If there is a change on the lead (Lead name changes) - I would have to create a workflow to also update the LeadStatusTracker FirstName field, which is doable but pollutes the environment with more code / more things to track / more things to keep in sync.

The way we achieve the business goal you are seeking is as follows:

  1. Use record revisioning. This means that (via a record revision block on a record page) you get to see the change history of a lead status from say, cold to warm to hot, the date/time of the change, the user that made the change, along with any other changes made to the Lead during the record update. This means that you may not need LeadsStatusTracker as a seperate/ unique module - LeadStatus could merely be a dropdown field in the Leads module.

  2. Use a workflow prompt to capture qualitative or categorial notes from the user when making a change to the LeadStatus field in the Leads module, asking for any additional information which is then inserted into a new Notes module record linked to the Lead and/or Contact module record.

Hope this helps :sunglasses:

1 Like

Mark, that can certainly do it. I appreciate your pointing this out.

1 Like

Is it possible do the following?
Say you have a module X with 2 fields: start-date-time and end-date-time. Within the same module, you add a 3-rd field: duration-In-hours that in the field expression for instance, refers to those 2 (end-date-time - start-date-time) and you get back the difference. While at it just trying to see how much flexibility there within the same module when working with fields.

Yes - that’s achievable using a beforeCreate and beforeUpdate trigger set. You would use an expression to determine the duration between
the two date/time fields.

1 Like

Thanks for your response, Mark!
Is there a way to simply combine 2 fields (without any manipulation)?

Say I have a Module A with fields FirstName and LastName?
Is there a way (without having to use before and after) to simply add a 3-rd field and put something like
FirstName+LastName and have it be dynamically displayed? (since it references those fields)

Hi @ashevelyov

You could try a field expression
https://docs.cortezaproject.org/corteza-docs/2023.9/integrator-guide/compose-configuration/field-expr.html

Regards
Mark

1 Like