cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tlevine
Kudo Commander
Kudo Commander

For All, Patch/Update

Hi Community - 

 

I have tried a few different solutions found in the forum but I haven't been able to resolve the issue I am facing. What I am looking to accomplish is as follows:

 

On Visible of a Screen: If an item has a value of "Yes" in a collection field called Indicator, then I would like to update the collection for all items with a value of "Yes" to be "No")

 

I have tried the following but with no success:

 

ForAll('Collection', LookUp('Collection', 'Indicator' = "Yes"), Update(WSR, {Indicator: "No"})

 

Any suggestions?

 

Thx

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Super User II
Super User II

Hi @tlevine ,

 

Use UpdateIf function() as following:

 

UpdateIf(Collection, Indicator="Yes", {Indicator="No"})

 

Hope it helps !

View solution in original post

3 REPLIES 3
UdayAdhikari
Responsive Resident
Responsive Resident

Hi @tlevine - since you are updating all records with Indicator ="Yes" to "No", below code should be enough and is the most efficient performance wise:

UpdateIf(colCollection, Indicator = "Yes", {Indicator:"No"})

 

Thanks

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.

Thanks

gabibalaban
Super User II
Super User II

Hi @tlevine ,

 

Use UpdateIf function() as following:

 

UpdateIf(Collection, Indicator="Yes", {Indicator="No"})

 

Hope it helps !

View solution in original post

rickysydney
New Member

 

Hello all

  I am experiencing some issues with my ForAll Patch in Powerapps. I am trying to patch items that are checked with the CheckBox in a Gallery in Picture1 to my Sharepoint List. It seem like sometimes it works and other times it stops. I am not sure what I am doing wrong. If anyone have  better suggestion let me know.  

 

The code on my select of the checkbox is as follows:

If(
Checkbox1.Value = true,
Patch(SkillsBulk,ThisItem,{IsUpdated:true}),
Checkbox1.Value = false,
Patch(SkillsBulk,ThisItem,{IsUpdated:false}))

 

The code in my button to patch the data is as follows:

 

ForAll(
RenameColumns(
Filter(
SkillsBulk,
IsUpdated = true
),
"ID",
"EID"
),
Patch(
Resource_Skills,
Defaults(Resource_Skills),
{
Title: Title,
RS_RP_ID: LookUp( Resource_Profile, RP_Email = User().Email, ID),
RS_Skill_ID: EID,
RS_Email: User().Email,
RS_EMPLOYEE_LOOKUP_PROFILE:
{Id: LookUp(
Resource_Profile,
RP_Email = User().Email,
ID)
,
Value: User().Email,
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"},
RS_SkillGroup: SD_Practice,
RS_Employee: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Claims: User().Email,
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle: "",
Picture: ""
}
}
));
ClearCollect(
SkillsBulk,
AddColumns(
Skills,
"IsUpdated",
false
)
);

Navigate('Edit Entry',ScreenTransition.CoverRight)

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (61,659)