cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
russrimm
Level: Powered On

Patch null in a column

Hi all,

I'm seeing there is/was a bug preventing patching a null value.  It appears this is still the case?  

I'm trying to null out one column on the onchange of another column.  I've tried using UpdateIf and Patch unsuccessfully.  I just want it so that if something is entered into a row on column B, I need it to automatically empty out column A in the same row - either through the onchange of the cell in the gallery, or via the submit button after editing the cell.   Possible?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
cwebb365
Level 10

Re: Patch null in a column

You’ll have to use a variable and use it as the value() in the text of estimated control. Then onselect of the actual use a set(). However it probably would just be easier to throw an If(!isEmpty(actual.text),value(estimate.text),value(actual.text)) in your patch for that column you are updating.

Of if it’s two separate database columns then use that same command but put 0 in place of the value(actual.text) spot.

View solution in original post

5 REPLIES 5
cwebb365
Level 10

Re: Patch null in a column

What is the data type? Can’t just set it to blank?
russrimm
Level: Powered On

Re: Patch null in a column

They're both values.  Basically I have a column with estimated expenses and another with actual expenses.  If someone finally spends the money, they will update the actual expense text input in the gallery and I want the estimated value to change to 0 or null so it doesnt mess my calculations up (i'm combining estimated and actual together for the "remaining budget" value and don't want a single line item to count against them for the sum of both estimated and actual.

Thx

cwebb365
Level 10

Re: Patch null in a column

You’ll have to use a variable and use it as the value() in the text of estimated control. Then onselect of the actual use a set(). However it probably would just be easier to throw an If(!isEmpty(actual.text),value(estimate.text),value(actual.text)) in your patch for that column you are updating.

Of if it’s two separate database columns then use that same command but put 0 in place of the value(actual.text) spot.

View solution in original post

russrimm
Level: Powered On

Re: Patch null in a column


@cwebb365 wrote:
You’ll have to use a variable and use it as the value() in the text of estimated control. Then onselect of the actual use a set(). However it probably would just be easier to throw an If(!isEmpty(actual.text),value(estimate.text),value(actual.text)) in your patch for that column you are updating.

Of if it’s two separate database columns then use that same command but put 0 in place of the value(actual.text) spot.

Thanks that's helpful.  This is what I ended up with in my Patch statement.  

Estimated:If(IsBlank(ActualDataCard.Text),Value(EstimatedExpDatacard.Text),Value("0"))

 

I only want it to empty out the "Estimated" value in the modified line item when that line item's "actual" amount is updated.  So I used IsBlank vs IsEmpty.  I tried just using Value("") instead of Value("0") but Value("") doesn't modify the currently set Estimated value at all.  It'd be cool if I find a way to null the value out so it doesn't show a 0 but it should suffice for my needs.

 

cwebb365
Level 10

Re: Patch null in a column

Try reset(control) that should blank it on screen. But not sure if it’ll write null to datasource in patch.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 198 members 4,767 guests
Please welcome our newest community members: