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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Updating foreign key t...
Power Apps
Unanswered

Updating foreign key to null fails.

(0) ShareShare
ReportReport
Posted on by

Hi.

 

I have a PowerApp connecting to an Sql database in Azure.

My main case record have a foreign key to a status table, CaseStatusId (FK, int, null)

I have discovered some strange behaviour.

Adding status, OK.

Changing status, OK.

Removing status, setting status to null, failed. The update to the Azure database does not setting the CaseStatusId to null.

 

I have seen some issues regarding null values with PowerApps, but I have a big problem understanding that this is an issue.

Using normalized data should be strait forward. I mean, using foreign keys like this is really common.

 

/C3

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    on at

    Hi @Anonymous,

     

    What is the related formula that you used for saving the data to Azure SQL? Please share the formula here.

     

    Regards,

    Mona

  • Community Power Platform Member Profile Picture
    on at

    Hi.

     

    My primary table Case, have a foreign key CaseStatusId (int, null) to the table CaseStatus.

    This have the primary Key column Id, and a Name column. 

    In my edit case screen/Form I have a combobox with the CaseStatus (Loaded from a collection)

    This Combobox, CaseEditCaseStatusComboBox, is added to the Case.CaseStatus DataCard.

    The datacard have Default ThisItem.CaseStatusId and Update(Value(CaseEditCaseStatusDataCardValue.Text))

    The Default of CaseEditCaseStatusDataCardValue is CaseEditCaseStatusComboBox.Selected.Id.

    So my CaseEditCaseStatusDataCardValue.Text will always reflect the selected value of my Combobox.

    Problem is when I clear my combobox. The CaseEditCaseStatusDataCardValue.Text is then "".

    The update of the Azure database, will not set my Case.CaseStatusId = null.

     

    Hope this make sense.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard