web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Server response failed...
Power Apps
Answered

Server response failed...Object reference not set to instance of object

(0) ShareShare
ReportReport
Posted on by 534

I get these errors very frequently.  The D365 Entities are public and the data is there...the data renders in the controls, and the data saves.  Why is this happening and how can I prevent it?

 

tonykiefer_0-1649705773448.png

 

Categories:
  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @tonykiefer ,

     

    What code are you executing to receive these errors? Assuming it's a SubmitForm(), can you share the details of the form?

  • tonykiefer Profile Picture
    534 on at

    @BCBuizer You are correct...

    SubmitForm(EditItemForm); Set(currentRecord,Blank()); ResetForm(EditItemForm); Back(Fade)

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @tonykiefer,

     

    It seems to happen because you are passing a blank to a LookUp field. In the below topic you can find how to bypass the LookUp() when the combobox is blank to avoid this error:

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Object-Reference-not-set-to-an-instance-of-an-object/td-p/725823

  • tonykiefer Profile Picture
    534 on at

    Hi @BCBuizer,  I am looking at the solution you referenced.  I'm curious though...It seems this error only occurs on the "new form".  I use the display modes new, edit, and view for one form.  Would this solution work for the new form...or is there another way to manage the lookup?  Since this is a new record there should be no item to lookup, however on a "new" or "view" mode there is.

     

    What are your thought?  Is there a way to validate a lookup field for display mode edit and view vs new?

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @tonykiefer ,

     

    Hard to say anything yet at this moment. Do you know which field is causing the error? Any fields that references another DataCardValue connected to the FCBWAREHOUSES data source?

  • tonykiefer Profile Picture
    534 on at

    Hi @BCBuizer ....there are three field using the same data connection...

    tonykiefer_0-1649763315276.png

    The other thing that drives me crazy is...these aren't the only fields in my solution that shows errors on the lookup.  Previously these fields were connected to an onprem data source SQL and they never showed an error...now that the fields are connected to a D365 data source they shows errors.  The fields work fine but the error is there.

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    What are the error on these fields? Can you share the Items properties?

  • tonykiefer Profile Picture
    534 on at

    Hello @BCBuizer ...below are the ComboBox properties.  As mentioned...all CRUD operations are working with the controls...so why the errors are occurring is beyond me.  It does not seem a null check is necessary.  As mentioned before...these errors did not occur when attached to the on-prem SQL db...now they occur when attached to D365.

    tonykiefer_0-1649767918172.pngtonykiefer_1-1649767939841.pngtonykiefer_2-1649767962443.png

    If you notice...all three comboboxes reference the data from FBCWarehouse to generate 3 data point.

     

    1..DefaultPurchaseWarehouse

    2..DefaultInventoryWarehouse

    3..DefaultSalesWarehouse

     

    I should be able to use the same connection for all three controls as they save to different data points on the record.

     

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @tonykiefer ,

     

    So the issue is definitely with the DefaultSelectedItems properties of those controls. Assuming currentRecord is a variable, could it be this has a blank value when the form is in New mode?

  • tonykiefer Profile Picture
    534 on at

     I'm working on the IsEmpty validation for a combobox to see if it works but I'm getting an error on this code...

     

    If(IsEmpty(Fit_ComboBox.Selected),"",
    LookUp(FitLabels,'Fit Label ID' = currentColor.Fit)
    )

     

    tonykiefer_0-1649857359690.png

    The code looks complete to me...what do you suppose is this issue?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard