Skip to main content
Solved

Creating a new record from an old record

  • May 6, 2022
  • 6 replies
  • 89 views

Forum|alt.badge.img+2

I am reading a record from a SDE geodatabase and using that record to create a new record. What is happening though is that it is just overwriting the old record. I need to have two records at the end. I select it based on an id and essentially need to make a copy of the record and then overwrite some of the values. Any idea of how I can do that?

Best answer by koenterralytics

My writer is set to insert. I select a record based on an id number in the table. I then update the attributes based on user parameters. However, it is updating the original record. I want to keep the original record and create a new record based on values in it. So essentially I want to copy the entire record and overwrite some of the attributes and give it a new id number. Does this make sense? I can use a tester to select the record. I just can't seem to find a transformer that would make a copy of it after it is selected.

Hi Chris,

I think the screenshot from my previous message should work. To make it more clear I added some more context:

imageHopefully this helps! If not, feel free to email the workspace to koen@terralytics.nl

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

koenterralytics
Contributor
Forum|alt.badge.img+10

@chris28​ , my first guess would be that your output contains an OBJECTID or GlobalID and your writer is set to Update (instead of Insert). To be sure, you are trying to add a new record to the same table?


Forum|alt.badge.img+2
  • Author
  • 32 replies
  • May 6, 2022

@chris28​ , my first guess would be that your output contains an OBJECTID or GlobalID and your writer is set to Update (instead of Insert). To be sure, you are trying to add a new record to the same table?

My writer is set to insert. I select a record based on an id number in the table. I then update the attributes based on user parameters. However, it is updating the original record. I want to keep the original record and create a new record based on values in it. So essentially I want to copy the entire record and overwrite some of the attributes and give it a new id number. Does this make sense? I can use a tester to select the record. I just can't seem to find a transformer that would make a copy of it after it is selected.


koenterralytics
Contributor
Forum|alt.badge.img+10

My writer is set to insert. I select a record based on an id number in the table. I then update the attributes based on user parameters. However, it is updating the original record. I want to keep the original record and create a new record based on values in it. So essentially I want to copy the entire record and overwrite some of the attributes and give it a new id number. Does this make sense? I can use a tester to select the record. I just can't seem to find a transformer that would make a copy of it after it is selected.

Why do you want to make a copy if the data is already available in the dataset?

I think you can just insert the new records, but first make sure that the field ObjectID and/or Globalid are removed before it enters the writer.

But if you are really looking for a copy within the workspace itself, consider using the Cloner. Or just split the workflow in two separate lines. But I think I'm still missing the whole picture.

image


Forum|alt.badge.img+2
  • Author
  • 32 replies
  • May 6, 2022

My writer is set to insert. I select a record based on an id number in the table. I then update the attributes based on user parameters. However, it is updating the original record. I want to keep the original record and create a new record based on values in it. So essentially I want to copy the entire record and overwrite some of the attributes and give it a new id number. Does this make sense? I can use a tester to select the record. I just can't seem to find a transformer that would make a copy of it after it is selected.

The first record is for an invoice. The invoice is being cancelled so I need to keep the original record and update cancelled to 'YES" and then create a new record with a new invoice number based on the old record. A bunch of the fields with values will be set to negative based on the original invoice. (No idea how to sent a PM on here or I would. Total Newbie)


koenterralytics
Contributor
Forum|alt.badge.img+10
  • Contributor
  • 33 replies
  • Best Answer
  • May 9, 2022

My writer is set to insert. I select a record based on an id number in the table. I then update the attributes based on user parameters. However, it is updating the original record. I want to keep the original record and create a new record based on values in it. So essentially I want to copy the entire record and overwrite some of the attributes and give it a new id number. Does this make sense? I can use a tester to select the record. I just can't seem to find a transformer that would make a copy of it after it is selected.

Hi Chris,

I think the screenshot from my previous message should work. To make it more clear I added some more context:

imageHopefully this helps! If not, feel free to email the workspace to koen@terralytics.nl


Forum|alt.badge.img+2
  • Author
  • 32 replies
  • May 12, 2022

My writer is set to insert. I select a record based on an id number in the table. I then update the attributes based on user parameters. However, it is updating the original record. I want to keep the original record and create a new record based on values in it. So essentially I want to copy the entire record and overwrite some of the attributes and give it a new id number. Does this make sense? I can use a tester to select the record. I just can't seem to find a transformer that would make a copy of it after it is selected.

Thanks! It worked to remove the objectID.