Repro steps:
1) ClearCollect(ValueList, SQLServer.TableA);
2) Patch(ValueList, <Any item>, {NullValueColumn = 1});
3) Check value on NullValueColumn, it will still be null.
However, if 2 were:
Patch(ValueList, <AnyItem>, {NonNullNumberColumn = 1});
it would work fine. I have worked around this by updating the TableA view I'm using to have a value for NullValueColumn of IfNull(Value, 0), but this isn't always going to be an option, especially if pulling directly from a table rather than from a view.
Solved! Go to Solution.
HI @aabrin ,
Do you want to use Patch function to update a column which has a blank value within a Collection?
It is a known issue that, when using Patch function to update a column which has a blank value within a collection (collect data from a SP list), the new value would not updated into the column.
The user @ChadVKealey has faced same issue with you, please check my response within the following thread:
On your side, please consider take a try to enable the "Formula-level error management" option within Advanced settings of App settings of your app, re-publish your app and re-load it, then try your Patch formula again, check if the issue is solved:
In addition, you could also consider take a try to achieve your needs using UpdateIf function instead of Patch function:
UpdateIf(
ValueList,
LookUp(ValueList, PrimaryKeyColumn = "A specific value"), /* <-- Use LookUp formula to find the specific record you want to update */
{NullValueColumn = 1}
)
Please take a try with above solution, then check if the issue is solved.
More details about UpdateIf function, please check the following article:
Best regards,
Hi @aabrin
Yes, updating NULLs in local collections is a problem.
This thread here provides a bit more detail.
You can use the UpdateIf function in PowerApps to carry out what you're doing in your View, so this technique would work when you're retrieving data directly from tables. After calling ClearCollect, you would use:
UpdateIf(ValueList, IsBlank(NullValueColumn), {NullValueColumn :0})
HI @aabrin ,
Do you want to use Patch function to update a column which has a blank value within a Collection?
It is a known issue that, when using Patch function to update a column which has a blank value within a collection (collect data from a SP list), the new value would not updated into the column.
The user @ChadVKealey has faced same issue with you, please check my response within the following thread:
On your side, please consider take a try to enable the "Formula-level error management" option within Advanced settings of App settings of your app, re-publish your app and re-load it, then try your Patch formula again, check if the issue is solved:
In addition, you could also consider take a try to achieve your needs using UpdateIf function instead of Patch function:
UpdateIf(
ValueList,
LookUp(ValueList, PrimaryKeyColumn = "A specific value"), /* <-- Use LookUp formula to find the specific record you want to update */
{NullValueColumn = 1}
)
Please take a try with above solution, then check if the issue is solved.
More details about UpdateIf function, please check the following article:
Best regards,
Thanks for posting in the community @aabrin - can you review the above replies and update the thread if they were helpful?
Thank you,
User | Count |
---|---|
139 | |
132 | |
75 | |
72 | |
69 |
User | Count |
---|---|
213 | |
200 | |
64 | |
62 | |
54 |