How to fix my Rules Actions to copy data from geofield to geofield? I want to copy a geofield to another geofield in the same content type.

I created a Rule where I &quot;Set Data Value&quot; and with that I copy the data of one geofield into the other. Actually I created two actions one for longitude and latitude.
This action is triggered when &quot;After updating existing content&quot;.
I used VBO to parse through my nodes therefore the trigger to be fired and geofield data to be copied.

Nothing happens. I get two errors in error log saying:

Unable to evaluate action data_set.
Unable to modify data &quot;node:field-business-location...

I tried to expose the fields to rules by &quot;Entity has field&quot; condition but doesn't work either.
What am I doing wrong.
PS: There is also an option of &quot;Create Geofield values from Lat/Lon but I don't see how I can copy data from one Geofield to another Geofield like this.
My Rule Export

{ &quot;rules_copy_geolocation_data&quot; : {
&quot;LABEL&quot; : &quot;Copy geolocation data - Destinations&quot;,
&quot;PLUGIN&quot; : &quot;reaction rule&quot;,
&quot;OWNER&quot; : &quot;rules&quot;,
&quot;REQUIRES&quot; : [ &quot;rules&quot; ],
&quot;ON&quot; : { &quot;node_update--destination&quot; : { &quot;bundle&quot; : &quot;destination&quot; } },
&quot;IF&quot; : [
  { &quot;entity_is_of_bundle&quot; : {
      &quot;entity&quot; : [ &quot;node&quot; ],
      &quot;type&quot; : &quot;node&quot;,
      &quot;bundle&quot; : { &quot;value&quot; : { &quot;destination&quot; : &quot;destination&quot; } }
    }
  },
  { &quot;entity_has_field&quot; : { &quot;entity&quot; : [ &quot;node&quot; ], &quot;field&quot; : &quot;field_destination_location&quot; } },
  { &quot;entity_has_field&quot; : { &quot;entity&quot; : [ &quot;node&quot; ], &quot;field&quot; : &quot;field_business_location&quot; } }
],
&quot;DO&quot; : [
  { &quot;data_set&quot; : {
      &quot;data&quot; : [ &quot;node:field-business-location:lat&quot; ],
      &quot;value&quot; : [ &quot;node:field-destination-location:lat&quot; ]
    }
  },
  { &quot;data_set&quot; : {
      &quot;data&quot; : [ &quot;node:field-business-location:lon&quot; ],
      &quot;value&quot; : [ &quot;node:field-destination-location:lon&quot; ]
    }
  }
]   } }
Debugging is the art of taking away all possible reasons that may cause your issue ... Read on for more details to find out which one it might be, and how to possibly solve it.

Option 1: After updating actually happens before updating

Have a look at the issue about "After updating existing content" runs before content is saved, about an event which is a variation of your event here, and somehow explains that "after saving something" actually happens "before saving something". Therefor I'm about sure this is not a bug, but simply how the Rules module works.

A possible compromise to avoid these kind of issues, is to transform what you're trying to do into a Rules Component, so that your original Rule "schedules the execution" (using the Rules Scheduler sub-module) of that Rules Component. For example after only a few seconds or minutes if your cron job runs frequent enough (otherwise it'll be next time cron runs). This compromise will ensure that, at the time the Rules component is executed, the entity is for sure saved (so that can't be the reason anymore then why things don't work as expected).

Option 2: Add an extra Rules Action 'Save Entity'

Another cause of possible confusion is within the Rules module, where sometimes it gets tricky to "save entities". So possibly adding an appropriate "save entity" action (after the 2 Rules Actions you already have) may also help (if nothing else helps).

Option 3: Rules debugging

Rules is great, but sometimes also tough to debug if things don't work as you'd expect. There are some typical facilities to do such debugging (further detailed below), but a Keep-It-Super-Simple technique I often use, is my BINGO-trick. A sample of such rule can be found in my answer to "Which Rules condition can be used to email a user when an admin updates their profile?". Stupid, but simple and efficient (I think). If tis doesn't help, then there are typically 2 ways of more advanced debugging:


Rules Evaluation Log

Within the Rules settings, experiment a bit with the debugging facilities that come with the rules module. At least have a look at the "Rules Evaluation Log" (to check that the Rules logic being executed, actually matches what you expect that logic to be).
Rules Action to display a value (using devel)

You may also want to (temporary) enable the Devel module, so that you can (temporary) add a Rules Action like "Display a value".

Obviously, make sure that there are no Rules Conditions that would prevent the Rules Action(s) from being executed (if needed temporary remove such Rules Conditions).


For way more details about these 2 variations, refer to Rules debugging, as explained in the answer to "How can I display the value of a variable inside a condition?".