<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cm2.liecourt.com/index.php?action=history&amp;feed=atom&amp;title=Template%3AChange_value</id>
	<title>Template:Change value - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://cm2.liecourt.com/index.php?action=history&amp;feed=atom&amp;title=Template%3AChange_value"/>
	<link rel="alternate" type="text/html" href="https://cm2.liecourt.com/index.php?title=Template:Change_value&amp;action=history"/>
	<updated>2026-04-11T14:12:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://cm2.liecourt.com/index.php?title=Template:Change_value&amp;diff=116&amp;oldid=prev</id>
		<title>Maintenance script: Fill database</title>
		<link rel="alternate" type="text/html" href="https://cm2.liecourt.com/index.php?title=Template:Change_value&amp;diff=116&amp;oldid=prev"/>
		<updated>2020-05-13T19:24:46Z</updated>

		<summary type="html">&lt;p&gt;Fill database&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Managed&lt;br /&gt;
|Version=1.1&lt;br /&gt;
|Version notes=1.1 - Added optional parameter &amp;quot;Query&amp;quot;, useful for properties of subobjects&lt;br /&gt;
1.0.1 - Copied this template from wiki.broadhorizon.nl to i.wikibase.nl, as it might be useful for other wikis&lt;br /&gt;
1.0 - First managed version (T3495)&lt;br /&gt;
|Short description=This template queries the property values of the current page, then adds or removes the value in parameter 3. This template can be used to add or remove a value from a parameter through wsform. Because of the use of subst, the parameter will be updated upon saving and you don't have to predefine the full parameter in the form. Note that values must be comma-separated, though the template could be updated to allow specifying a separator.&lt;br /&gt;
|Feature=Wiki:Feature/1530870851&lt;br /&gt;
|Status=Live&lt;br /&gt;
|Uses managed items=}}&lt;br /&gt;
&lt;br /&gt;
This is the ''Change value'' template. It should be called in the following format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{subst:Change value&lt;br /&gt;
|1= Property &lt;br /&gt;
|2= &amp;lt; Add / Remove &amp;gt;&lt;br /&gt;
|3= &amp;lt; text &amp;gt; value to add to or remove from the property&lt;br /&gt;
&lt;br /&gt;
|Query= &amp;lt; Optional: SMW query statement &amp;gt; instead of using show:{{FULLPAGENAME}}, an ask with the query statement will be performed to find the current property value&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples (but you'll have to try them on a page that has the property):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{subst:Change value |Favorite work instruction pageid |Remove | 27455 }}&lt;br /&gt;
&lt;br /&gt;
{{subst:Change value |Favorite customer pageid |Add |29323 }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template can also be used as a regular template, since safesubst is used, though I'm not sure if this would be useful anywhere:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Change value&lt;br /&gt;
|1= Property &lt;br /&gt;
|2= &amp;lt; Add / Remove &amp;gt;&lt;br /&gt;
|3= &amp;lt; text &amp;gt; value to add to or remove from the property&lt;br /&gt;
&lt;br /&gt;
|Query= &amp;lt; Optional: SMW query statement &amp;gt; instead of using show:{{FULLPAGENAME}}, an ask with the query statement will be performed to find the current property value&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{ safesubst:#vardefine:@current value |{{ safesubst:#if:{{{Query|}}}&lt;br /&gt;
  | {{ safesubst:#ask:{{{Query|}}} |?{{{1|}}}#= |mainlabel=- |link=none |limit=1 |searchlabel=}}&lt;br /&gt;
  | {{ safesubst:#show:{{ safesubst:FULLPAGENAME}} |?{{{1|}}}# |link=none }} &lt;br /&gt;
}} }}{{ safesubst:#if:1||&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;}}{{ safesubst:#switch:{{{2|}}}&lt;br /&gt;
|Add|#default={{ safesubst:#arraydefine:$new value |{{ safesubst:#if:{{ safesubst:#var:@current value}} |{{ safesubst:#var:@current value}},}} {{{3|}}} }}{{ safesubst:#arrayunique:$new value}}{{ safesubst:#vardefine:@new value |{{ safesubst:#arrayprint:$new value}} }}&lt;br /&gt;
|Remove={{ safesubst:#arraydefine:$current value |{{ safesubst:#var:@current value}} }}{{ safesubst:#arraydefine:$remove value |{{{3|}}} }}{{ safesubst:#arraydiff:$new value |$current value |$remove value}}{{ safesubst:#vardefine:@new value |{{ safesubst:#arrayprint:$new value}} }}&lt;br /&gt;
}}{{ safesubst:#if:1||&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;}}{{ safesubst:#var:@new value}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>