Help

Re: I want an automation that will copy fields from a linked record, but only to empty fields

Solved
Jump to Solution
646 3
cancel
Showing results for 
Search instead for 
Did you mean: 
mmr1443
6 - Interface Innovator
6 - Interface Innovator

Structure is as follows:

Project tab has all of our project records with around 50 fields of project-specific details.
Some project records are categorized as "Original Project" and some are categorized as "Revision"
"Revisions" are linked to their "Original Project"

I want to do the following:
1. Create a new "revision record"
2. Fill out ONLY the fields that will be changing 
3. Link the "original project" in the "Original associated project field"
4. When that field is updated, I want an automation to run that will copy and paste fields from the original project record to the revision project record, but ONLY for fields of the revision record that are empty.

Example:

"Original project record" fields/Project info:
Unique Project Number: #557 (Autonumber)
Customer name: John Doe
Solar module: Mission Solar 400W
Quantity: 25
Inverter: Solaredge 7600kW
Project type: Original Project
Associated Original project: None

"Revision project record" fields/Project info
Unique Project Number: #558 (Autonumber)
Customer name: 
Solar module: Mission Solar 440W
Quantity: 23
Inverter: 
Project type: Revision Project
Associated Original project: #557 (this is a linked field, and I can select the original project from a drop down menu)

So I want the automation to copy the "Customer Name" and "Inverter information" from the Original Project Record to the Revision Project Record. And I want it to trigger when the "Associated Original Project" field is updated and a record is selected and linked.

I have done a handful of automations successfully but this one is really stumping me. Getting the trigger to work is easy. I can't figure out how to get it to copy/paste other fields from the linked record. And then I can't figure out how to get it to only do that when the field is empty.

Thanks so much in advance for any help!!!

1 Solution

Accepted Solutions

I haven't tested this, but you could try this option:

Trigger: When Record Matches Conditions
When {Customer Name} [is NOT empty], AND when {Solar Module} [is NOT empty], etc for each field

Action: Find Records, find "Original Project"

Make a conditional step for each Field

1. If {Customer Name} [is empty]

  • Update - Input "Original Project" data

2.  If {Solar Module} [is empty]

  • Update - Input "Original Project" data

Etc for each field

Final Condition: IF {Customer Name}, {Solar Module}, etc [is NOT empty]

  • Leave Blank (do nothing)

This, in theory, should run the automation and find a blank to fill, then trigger itself again to find another blank. So the only caveat to this would be that you can't have a blank field in the original being copied over as it'll stop the automation loop from finishing.

Meaning that all fields need to have some data to have the automations cycle through. You could probably make sure the original project has "N/A" in any blanks I suppose?

See Solution in Thread

6 Replies 6
Sistema_Aotearo
7 - App Architect
7 - App Architect

Hello! You'll have to make individual automations for each field you'd like to be looked at.

Trigger: When field is updated, watching {Customer Name}

Action: Find Records, find "Original Project"

From here, make 2 conditional steps:

1. If {Customer Name} [is empty]

  • Update - Input "Original Project" data

2. If {Customer Name} [is not empty]

  • Leave Blank (do nothing)

Then duplicate the automation for each field. I think this should solve what you're trying to achieve, but let me know how you go 🙂

Hi! Thanks for your response! Is there a way to do this and combine it all into a single automation? Or would I need to create an individual automation for each field? I have about 50 fields I'm trying to do this with. 

I haven't tested this, but you could try this option:

Trigger: When Record Matches Conditions
When {Customer Name} [is NOT empty], AND when {Solar Module} [is NOT empty], etc for each field

Action: Find Records, find "Original Project"

Make a conditional step for each Field

1. If {Customer Name} [is empty]

  • Update - Input "Original Project" data

2.  If {Solar Module} [is empty]

  • Update - Input "Original Project" data

Etc for each field

Final Condition: IF {Customer Name}, {Solar Module}, etc [is NOT empty]

  • Leave Blank (do nothing)

This, in theory, should run the automation and find a blank to fill, then trigger itself again to find another blank. So the only caveat to this would be that you can't have a blank field in the original being copied over as it'll stop the automation loop from finishing.

Meaning that all fields need to have some data to have the automations cycle through. You could probably make sure the original project has "N/A" in any blanks I suppose?

This is clever! I ended up using a much clunkier workaround, so I probably won't be trying this right away since my way works for now and I don't want to redo the whole thing immediately. But this is definitely better and I'll come back to it when the fields change and it's time to update everything. Creating "n/a" as a default value is not ideal but is a good workaround.

The workaround I used was to create TWO additional fields, for every single one of the 50 unique fields. The first one would be a lookup field for the correlating field in the associated project. And then the second addition field is a formula field that says IF(("solar module field for revision project" has a value), (show value of "solar module field for revision project"), (otherwise, show value of "solar module field for associated original project"))

So what was 50 fields is now 150. Very clunky, but it works. Like I said, when it comes time to change our fields up, I will come back and give your solution a try. Thanks for the response!

mmr1443
6 - Interface Innovator
6 - Interface Innovator

So I am having to create another function that does something along these lines, so I'm returning to this post.

I have a lot of formula fields that have "If field is not empty" as a part of the formula, so adding blank spaces or "N/A" is not a super viable option.

But would it be possible to tweak the way this functions? Could the trigger change so that it's looking at what you referred to as "the original that's being copied" and only copy over the fields that are not blank?
 
Thoughts?

Also- I'm confused by "make a conditional step for each field"- what does that look like? When I create more than one action, it says "otherwise" at the top, implying it's an either/or situation

The automation has to look at the new record. It won't know which fields on the new record are blank if it's only looking at the original.

We're telling the automation to:
Look at the new record >
Find the original >
Only do the next step if the new record has a blank in field 1 OR field 2 OR field 3 OR etc >
Copy everything over >
Start automation again

The automation checks the fields in the order you create those conditions. 1, 2, 3.
So once the automation starts again, field 1 MUST NOT be blank to continue to the next field to check. Otherwise, it'll keep doing field 1 again and again.

My suggestion for fixing your formulas is to make it have "If field contains (N/A)" instead of looking for blanks