open id 

HomeIntegrations

Relates to using integrations in Decisions

Using the Insert or Update Step Messages in this topic - RSS

dennisbaker
dennisbaker
Posts: 5


6/24/2019
dennisbaker
dennisbaker
Posts: 5
I was wondering if someone could supply an example of how and when to use the Insert or Update step that is exposed on a database table. I'm assuming this step can compare an object passed to it and make some sort determination as to whether an existing DB record should be updated or a new DB record should be created, but I can't find it documented anywhere. It seems like it would be extremely useful in creating an ETL flow.
0 link
kenan@decisions.com
kenan@decisions.com
Administrator
Posts: 251


6/25/2019
kenan@decisions.com
kenan@decisions.com
Administrator
Posts: 251
Hi Dennis,


Insert or Update Step is combining both insert and update functionality together. If you want to use this step for insert functionality you have to define primary key different than the existing table primary key values. This will add a new row to the table. If you want to update an existing row you need to define that row's primary key in the input area.



In order to see the table fields as input areas in your Insert or Update Step properties, you should select the input area as Build Array and select the first array as Build Data. This setting will give you all the table fields. You can select the necessary fields from here. In both update or insert functionality, you should always include the primary key field.


I attached an example to demonstrate this combine behavior. In my example, I have an entity_account table with some account information. The primary key of this table is Account Id. So, in order to add a new account to the table, I am filling the Account Id input field with a unique new id. If I want to update an existing row, I need to fill Account Id field with respective account id. I put a form with a data grid to facilitate viewing table changes.


In addition to the example, the below documentation can be helpful. Please check example/documentation and if you have any question please let me know.


Integrate with Database Table
Use Flow Steps to Integrate External Database


Regards






edited by kenan@decisions.com on 6/25/2019

0 link






Powered by Jitbit Forum 8.3.8.0 © 2006-2013 Jitbit Software