Find "USER OBJECT" (Object 1) record ID when using ajax to connected role table

Hello Knack Community,

 

I am using an Ajax post to insert a new user record into one of the "role objects" that is automatically connected to the main users object (object 1).

For example:

Users (Object 1)

     -> Players (Object 15)

 

If my ajax call inserts into object 15, Knack automatically creates a row in Object 1 just because of the way knack is designed.  In the success response from knack on the ajax call into object 15, I get the record ID for the record inserted into object 15, but I don't get anything back regarding the record id for the record that was created in object 1 automatically.

Does anyone have any idea how I can get that record id for the record that was created in object 1 when I post into object 15?

Thanks!

-Jeff

You will probably need to send a second API call to the other object. Search this forum for 'one call after another.' You can use that as a template. In the second call set up filters to find the corresponding record you just created. If they do not share a field naturally to search for  ie user.email then first create a text formula field or formula field in object 2 that displays some unique field data from Object 1. You can then use filters to find the right record using that field and retrieve it's record.id. Filter examples are in the Knack developer docs. Best of luck solving your problem :)