<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Save_Relational_Data_Node_in_Pathways</id>
	<title>Save Relational Data Node in Pathways - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Save_Relational_Data_Node_in_Pathways"/>
	<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Save_Relational_Data_Node_in_Pathways&amp;action=history"/>
	<updated>2026-06-22T03:41:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://docs.foji.io/index.php?title=Save_Relational_Data_Node_in_Pathways&amp;diff=2767&amp;oldid=prev</id>
		<title>Mitchell.Hirsche: Mitchell.Hirsche moved page Documentation for the &quot;Save Relational Data&quot; Node in Pathways to Save Relational Data Node in Pathways</title>
		<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Save_Relational_Data_Node_in_Pathways&amp;diff=2767&amp;oldid=prev"/>
		<updated>2025-03-05T23:05:47Z</updated>

		<summary type="html">&lt;p&gt;Mitchell.Hirsche moved page &lt;a href=&quot;/wiki/Documentation_for_the_%22Save_Relational_Data%22_Node_in_Pathways&quot; class=&quot;mw-redirect&quot; title=&quot;Documentation for the &amp;quot;Save Relational Data&amp;quot; Node in Pathways&quot;&gt;Documentation for the &amp;quot;Save Relational Data&amp;quot; Node in Pathways&lt;/a&gt; to &lt;a href=&quot;/wiki/Save_Relational_Data_Node_in_Pathways&quot; title=&quot;Save Relational Data Node in Pathways&quot;&gt;Save Relational Data Node in Pathways&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:05, 5 March 2025&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wiki:diff::1.12:old-2640:rev-2767 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mitchell.Hirsche</name></author>
	</entry>
	<entry>
		<id>https://docs.foji.io/index.php?title=Save_Relational_Data_Node_in_Pathways&amp;diff=2640&amp;oldid=prev</id>
		<title>Mitchell.Hirsche: Save Relational Data</title>
		<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Save_Relational_Data_Node_in_Pathways&amp;diff=2640&amp;oldid=prev"/>
		<updated>2025-03-04T23:38:51Z</updated>

		<summary type="html">&lt;p&gt;Save Relational Data&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;Save Relational Data&amp;#039;&amp;#039;&amp;#039; node in Pathways allows workflows to insert or update rows in a relational database. It provides the flexibility to define target tables and dynamically populate column values using either &amp;#039;&amp;#039;&amp;#039;Handlebars Templates&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Scripts&amp;#039;&amp;#039;&amp;#039;, ensuring seamless data manipulation.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Node Properties&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;1. Name&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: A unique identifier for the node within the workflow.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Provide a descriptive name to indicate the purpose of the node (e.g., &amp;quot;Update Invoice Records&amp;quot; or &amp;quot;Insert New Claims&amp;quot;).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;: &amp;#039;&amp;#039;&amp;#039;&amp;quot;Save Payment Details&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;2. Target Table&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: Specifies the name of the relational database table where the data will be saved.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Select the appropriate table for data insertion or updates.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;: &amp;#039;&amp;#039;&amp;#039;invoices&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;customers&amp;#039;&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;&amp;#039;orders&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Data Section&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Data&amp;#039;&amp;#039;&amp;#039; section allows you to define which columns in the target table are updated or populated, along with their corresponding values.&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;3. Column&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: Specifies the column in the target table to update or populate.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Select the column that corresponds to the data being saved.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;: &amp;#039;&amp;#039;&amp;#039;invoice_status&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;payment_date&amp;#039;&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;&amp;#039;customer_email&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;4. Expression&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039;: Handlebar Template or Script&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: Defines the value to be assigned to the column.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Options&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Handlebar Template&amp;#039;&amp;#039;&amp;#039;: Use placeholders to inject dynamic values into the column.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{payment_status}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Where payment_status is a variable from the workflow.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Script&amp;#039;&amp;#039;&amp;#039;: Write custom logic to generate or calculate the column value dynamically.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039; (Script):&lt;br /&gt;
&lt;br /&gt;
if payment_completed:&lt;br /&gt;
&lt;br /&gt;
   return &amp;quot;Completed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else:&lt;br /&gt;
&lt;br /&gt;
   return &amp;quot;Pending&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Expression Field&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Status&amp;#039;&amp;#039;&amp;#039;: Required for each column being updated.&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Usage&amp;#039;&amp;#039;&amp;#039;: Define the value for the column dynamically to adapt to varying workflow scenarios.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;How It Works&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Define Target Table&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Select the relational database table where data will be inserted or updated.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Configure Columns and Values&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Specify the columns to be updated in the &amp;#039;&amp;#039;&amp;#039;Column&amp;#039;&amp;#039;&amp;#039; field.&lt;br /&gt;
#* Define the corresponding values using either Handlebar Templates or Scripts.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Save Data&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* When the workflow reaches this node, the defined data is saved to the target table.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Insert or Update Behavior&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Depending on the database configuration, this node can either insert a new row or update an existing row based on matching criteria (e.g., a primary key).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Use Case Examples&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;1. Insert New Payment Records&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;: Insert Payment Records&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Target Table&amp;#039;&amp;#039;&amp;#039;: payments&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Data&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Column&amp;#039;&amp;#039;&amp;#039;: payment_id&lt;br /&gt;
*** &amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039;: &amp;lt;nowiki&amp;gt;{{payment_id}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Column&amp;#039;&amp;#039;&amp;#039;: amount&lt;br /&gt;
*** &amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039;: &amp;lt;nowiki&amp;gt;{{payment_amount}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Column&amp;#039;&amp;#039;&amp;#039;: status&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039; (Script):t&lt;br /&gt;
&lt;br /&gt;
if payment_confirmed:&lt;br /&gt;
&lt;br /&gt;
   return &amp;quot;Confirmed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else:&lt;br /&gt;
&lt;br /&gt;
   return &amp;quot;Pending&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Outcome&amp;#039;&amp;#039;&amp;#039;: Inserts a new payment record into the payments table.&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;2. Update Invoice Status&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;: Update Invoice Status&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Target Table&amp;#039;&amp;#039;&amp;#039;: invoices&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Data&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Column&amp;#039;&amp;#039;&amp;#039;: status&lt;br /&gt;
*** &amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039;: &amp;lt;nowiki&amp;gt;{{invoice_status}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;Column&amp;#039;&amp;#039;&amp;#039;: updated_at&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Expression&amp;#039;&amp;#039;&amp;#039; (Script):&lt;br /&gt;
&lt;br /&gt;
return current_timestamp()&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Outcome&amp;#039;&amp;#039;&amp;#039;: Updates the status and timestamp of invoices in the invoices table.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Best Practices&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Define Columns Explicitly&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Specify only the columns that need to be updated to optimize performance.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Parameterize Values&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Use dynamic templates or scripts for flexibility, especially in workflows handling varying data.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Test Queries&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Validate database changes in a test environment before deploying to production.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Maintain Data Integrity&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
#* Ensure primary keys or unique constraints are respected to prevent unintended data duplication.&lt;br /&gt;
&lt;br /&gt;
----The &amp;#039;&amp;#039;&amp;#039;Save Relational Data&amp;#039;&amp;#039;&amp;#039; node is a powerful tool for managing relational database updates in Pathways, offering robust customization options through Handlebar Templates and Scripts. This flexibility ensures compatibility with diverse data processing needs.&lt;br /&gt;
[[Category:ForgeAI]]&lt;br /&gt;
[[Category:Pathways]]&lt;/div&gt;</summary>
		<author><name>Mitchell.Hirsche</name></author>
	</entry>
</feed>