Get Last ID, Insert Into Other Table

I want to do this

get value from multiple select as newRefs;

insert into table1 ('name') values ('pete');

SELECT LAST_INSERT_ID() as newUserId;

for each (currentRef in newRef) {

     insert into lookupTable1 (userId,ref) values (newUserId,currentRef);

}

Actually there is a quicker way to do this with MySQL/MariaDB as noted here
https://dev.mysql.com/doc/refman/8.0/en/insert.html

What do I need to do this?
Do I use Data Store Entities, Record Types, etc.?
I can't be the first one that want to do something like this.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to petel0001

    Could it be that you do not store the "stored values" from the outputs tab of the first write records node back to the PV?

    I suggest to do one step after the other, and also validate each step.

    Assign the data coming from the interface to PVs -> Does this data show up?

    Store data to the record -> Does it show up in DB?

    Store stored values back to PV -> Does it do that?

    .

    .

    .

    Once you are more familiar with Appian, you might be able to skip a step or two. But even I, after 13 years do not do more than two or three steps without test and validation.

Children