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

Problem using multiple Patch in a colection

Hey there, hope yall are doing good!

So, i have this little issue trying to use the same formula I use when I want to Patch multiple records from a table in SQL but on a collection,
theres is a screnshot of the formula so, the issue happens when I press the button whit the formula, it is supposed to check every single combo box and if its not  blank then patch the record on a collection and if its blank do nothing, the formula runs okay on the first IF statment but then it stops on the other comboboxes and if i click the button with this formula again  it add another record which its very weird

If someone have any idea about why this is happening I will really appreciate

thanks in advance!

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Jose_LuisA ,

Try this small modification - instead of

!IsBlank(NumeroEmpleadoTECB_1)

Assuming these are Choice fields in the box

If(
   Len(NumeroEmpleadoTECB_1.Selected.Value)>0
   . . . . 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thank you so much Warren

It helped me with some issues, but the problem that the formula stops when a predecessor If results true still remains

I don't know if this is caused by the fact that I'm using a Collection instead of a SQL Table or any other data source
because I'm using this formula on another application that patch the collected records to fix the wrong ones from another registration app (attendance app)

 

Let me explain a lil bit more:
I'm trying to patch 2 or more records from a Collection, but if there's an IF that results true, the below IFs don't work, this is kind of weird because as I said before I'm using the same formula for another application and it works pretty well, so what I'm doing right now is to add a button for every single change, and I wanted to see if there's a way to put all those changes in a single button as I do on other applications 

 

Thanks in advance

 

 

Jose_LuisA_0-1623857547010.png

 

Hi @Jose_LuisA ,

I am not sure why it would be doing that, however another way of approaching it would be to Patch the items individually when they are changed.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

v-jefferni
Community Support
Community Support

Hi @Jose_LuisA ,

 

You may try below:

Patch(
      DataSource,
      Gallery.Selected,
      {
       Column1: If(!IsBlank(Combobox1.Selected.Value),Combobox1.Selected.Value,Blank()),
       Column2: If(!IsBlank(Combobox2.Selected.Value),Combobox2.Selected.Value,Blank()),
       Column3: If(!IsBlank(TextInput.Text),TextInput.Text,Blank()),
       ...
      }
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,848)