Updating Related Records via related actions

Certified Associate Developer

I have two tables with a one to many relationship, an owners table and a pets table which are connected via the Owner ID. The owner can have many pets. I am trying to add an action under the owner summary view for the user to be able to add a new pet that belongs to the owner but I am struggling with how to connect the two records. I have created a related action under owner that points to the add / update pet but I am struggling to connect the owner ID to the pet being added, any help would be greatly appreciated! 

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to desmondw

     
    Your approach is correct if you're using a milestone.
    I assume you've already completed this step: The Owner to Pets relationship is one-to-many, with ownerId as the common field.
    If you're currently on the milestone of adding owner details, you can directly use the owner record fields to save data. When you proceed to add pet details, use the owner.relationship.pets.fields to add pet details. Once you've saved both owner and pet details in the owner record, simply use the write record function or a smart service to write to the database. Appian will automatically add the ownerId to the pets table to create the relationship; you don't need to manually input it.

  • 0
    Certified Associate Developer
    in reply to Shubham Aware

    This is the route I ended up going down in my troubleshooting, thank you!