cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
santpaiva
Helper I
Helper I

Erase information from a choice

 

Hello everyone

I have in the App an editable form referring to a product, in this form the user can change the name of the responsible seller (connected to a column in the SP List, which is of type Person) and the status of the products (connected to a column in the SP List, which is of the Choice type).

I want to perform a specific action: When the user changes the status (Choice type) to "Free" (in DataCardValue_Status) I would like the Seller's name to be deleted and become blank (the DataCardValue_vendor would be empty).
I tried the code:
On Datacardvalue_status in OnChange I did "if (datacardvalue_status =" Free ", Reset (datacardvalue_vendedor))" but that did not delete the SP List salesman's name.
Would anyone have an idea of what I can do?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@santpaiva 

It is NOT possible to set a column to blank without the Formula Level error management ON.  

You cannot use Patch, Update, SubmitForm or any other function to blank a column without that option on.

 

I would strongly advise to focus on the issues that are in error when that feature is turned on as those are REAL errors that should be fixed.  If you have difficulty figuring out how to fix them, then please post the problems to the forum here to get them resolved.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@santpaiva 

Remove the OnChange actions and the Reset function you have and instead set the DefaultSelectedItems property of the combobox that you want to be cleared to the following:

   If(datacardvalue_status = "Free", Blank(), Parent.Default)

 

Also, in order to write back the blank value to the list, make sure you have the Formula-level error management option turned ON in your advanced settings.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
santpaiva
Helper I
Helper I

My Formula-level error management was turned off, initially.
I used your code and he deleted the name of the seller only on the app screen but not in the SP List.

Then, when I turned on Formula-level error management, the application started to show several errors and did not fulfill the functions it used to do, nor did I delete the salesman's name on the screen (as his code did when it was turned OFF)

As I already said, your code partially fulfilled the function and erased the name of the seller on the app screen but did not update the database. Because of that, wouldn't you know any other way for me to just throw this update on the list now?
I already use an editable form that in theory should change the SP List but that doesn't happen.

RandyHayes
Super User
Super User

@santpaiva 

The ONLY way you can set a column to blank in your list will be to have the Formula-Level error management on.

If you turn it on and it shows issues elsewhere in your app, you should focus on fixing them - because they are real errors!

 

If the blank value was not written back to the list WITH the formula-level error management on, then my question would be, what is the Update property of the Datacard that this field is in?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

The blank value was written back to the list with the formula-level error management on, but as I said, when this option is on, there are several errors in the application that I don't know how to solve, so I would like to save the blank value in the list by another way.

 

Are you sure that it is not possible to update the list with another function? In another situation I managed to do this with PATCH but now I'm not able to apply for this case of leaving it blank.

RandyHayes
Super User
Super User

@santpaiva 

It is NOT possible to set a column to blank without the Formula Level error management ON.  

You cannot use Patch, Update, SubmitForm or any other function to blank a column without that option on.

 

I would strongly advise to focus on the issues that are in error when that feature is turned on as those are REAL errors that should be fixed.  If you have difficulty figuring out how to fix them, then please post the problems to the forum here to get them resolved.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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