cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
C3
Frequent Visitor

Updating foreign key to null fails.

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

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @C3,

 

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

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
C3
Frequent Visitor

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.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,633)