How can I access Merge Syntax / Named Output in a Snippet?

Is this possible? I finally have a use case for named output. :smiley:

The elusive named output! I’m curious about your use case - I’ve always wanted to use it for something.

You should be able to make the Output value available to a snippet by creating an Action Sequence with an Input for the Output value (confusing, I know…), and then running the snippet from that Action Sequence. Snippets run from an Action Sequence have the Action Sequence Inputs available to them in the arguments, so you can get the $Output value that way.

Here’s a quick example page since the set up is a little convoluted:

<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" showheader="false">
		<model id="UI" limit="20" query="true" createrowifnonefound="true" datasource="Ui-Only">
				<field displaytype="TEXT" length="255" id="testfield"/>
		<skuid__buttonSet model="UI" uniqueid="sk-1kk0-11942">
				<skuid__buttonGroup uniqueId="sk-1kk0-11940">
						<skuid__button label="Update row" uniqueId="sk-1kk0-11941">
								<action type="updateRow" fieldmodel="UI" affectedrows="context">
										<update valuesource="fieldvalue" field="testfield" enclosevalueinquotes="true" value="test"/>
										<output id="rows" type="rows" name="updated_row"/>
								<action type="action-sequence" action-sequence-id="c1cfd4f4-8cc8-4a85-bb55-d2360d312f18">
										<input name="output_value" value="{{$Output.updated_row}}"/>
			<jsitem location="inlinesnippet" name="processOutput" cachelocation="false">const params = arguments[0];
output = params.$Input.output_value;

console.log("Output: ", output);</jsitem>
			<actionsequence id="c1cfd4f4-8cc8-4a85-bb55-d2360d312f18" type="reusable" label="Send output to snippet">
					<action type="custom" snippet="processOutput"/>
					<input type="value" name="output_value"/>