Help

Re: Create Record with Foreign Key - API c#

637 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Glenn_Cooper
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi chaps,

I’m using the API to add a new record to a table and getting stuck with a Foreign Key (Integer). I am using C# and the AirtableAPIClient Nuget Package.

This is where the code is tripping up:

            fields.AddField("Username", username);
            fields.AddField("Password", password);
            fields.AddField("Ref", Refs );

AirTable is returning a 422 error on the Refs field. The foreign key is a single link, not multiple. The column itself is a LongInt. I’ve tried adding an array, a single value, but not having any luck with this. Can someone please advise?

Thanks

1 Reply 1
Glenn_Cooper
5 - Automation Enthusiast
5 - Automation Enthusiast

Fixed, I needed to activate typecast and send the value over as a string instead of integer