sitecoresitecore8sitecore-rocks

Sitecore Rocks, copy value from one field to another


I have the following Sitecore Rocks query. I want to make the value of the Background Static Image field match the value of the Background Image field.

update set @#Background Static Image# = @#Background Image# from /sitecore/content/Sites/MySite/Assets/Global/#Hero Items#//*[@@templatename = 'Hero'];

When I run the update it says (131 items affected.). But, the Background Static Image field never gets updated.

This seems to be the correct syntax based on http://vsplugins.sitecore.net/Sitecore-Query-Update-Samples.ashx


Solution

  • I figured this out. To get it to work, I had to prepend an empty string (two single quotes and a plus sign) to the value.

    update set @#Background Static Image# = '' + @#Background Image# from /sitecore/content/Sites/MySite/Assets/Global/#Hero Items#//*[@@templatename = 'Hero'];