0

I'm using addFeatures in the REST API to add data to my table and it's working great. However... one of the fields in my data is a Related Record. I can query the Related Record fine using queryRelatedRecords, but Is there some way I can add related records via addFeatures? There doesn't seem to be an addRelatedRecords entrypoint. Here's what I would pass to addFeatures in my dream world...

$ev = (object)[
    'attributes' => (object)[
        'EVENTNAME' => 'test',
        'eventlocations' => list_of_locations_somehow?
    ],
];
Chris Rae
  • 111
  • 4
  • (Without pulling up the REST doc, I think:) Your related records are probably just a table in the same service, so you'd call addFeature on that resource. So your workflow would be 2 addFeatures on the respective layer/table – KHibma Feb 17 '22 at 19:18
  • Thank you for looking - do you know how I'd go about associating the new records in my event locations table with this related record in my original table? – Chris Rae Feb 17 '22 at 19:37
  • You'd need to essentially follow the rules of your relationship. Meaning that on both addFeature calls you'd need to set the matching values in the established join field. (Again, I'm making some untested assumptions) – KHibma Feb 17 '22 at 20:44

0 Answers0