-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in CreateRequest when a lookup field is null/undefined in target object #47
Comments
I just tested with create request Web API in Postman. Turns out setting null to a lookup field we need to use the Schema Name instead of the Logical Name. It's quite inconvenient when they are different, usually upper case vs lower case like this: Display Name: Lookup Field so the payload should look like this:
Can we have some logic to check for this scenario and construct the payload correctly? |
Proposed a fix in a PR |
Hi @khoait - I completely missed this PR - sorry it's take me over a year to get to it! I merged in and the nullvalues integration test started to fail:
Perhaps this issue is specific to batch requests? |
Thanks @scottdurow ! It happens to a single create request as well. I'll review the tests. |
@scottdurow I added unit tests and passed all tests. please have a look. |
Ah - ha! So it's the case sensitivity of the lookup field. Awesome job in spotting and fixing this! |
yeah! it was very tricky when I first encountered the error. I came up with a convention within the team to always modify the logical name to lowercase whenever we create a new field to keep it consistent for sdk and odata. I hope the fix will be available soon! Cheers! |
I'll get this merged and published asap! |
That's great to hear! Thanks @scottdurow ! |
Hi,
I'm using dataverse-ify version 2.0.7. I'm trying to send a batch request using the
executeMultiple
function. When the target object contains a lookup field with undefined/null value, I get the below error.I also checked the normal
create
function and got the same error. The target object looks like this:The text was updated successfully, but these errors were encountered: