web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Retain Previously Patc...
Power Apps
Answered

Retain Previously Patched Values in SharePoint List When Updating Specific Columns

(0) ShareShare
ReportReport
Posted on by 136

Hello Community,
I have a power apps, 
My requirement: I have columns with Headers With name 1 to 10,
PrudhviL_0-1713657068007.png
I want to update few columns with different values For that I Built an app with 3 fields (Start Column, End Column, Value)
Lets Say for example I want to Update the columns from 1 to 6 with value '999' and then I want to update values 7 to 10 with '123'

PrudhviL_1-1713657484514.png

 


For this I used formula on the Update Button

ClearCollect(
 colTemp,
 ForAll(
 Sequence(10), // Create a sequence from 1 to 10
 {
 Id: Value,
 Value: If(
 Value(ST_1.Text) <= Value && Value(ET_1.Text) >= Value,
 Value(ValueT_1.Text),
 Blank() // If the condition is not met, store a blank
 )
 }
 )
);
UpdateIf(
 TenderCosting,
 ID = Gallery1.Selected.ID,
 {
 '1': LookUp(colTemp, Id = 1).Value,
 '2': LookUp(colTemp, Id = 2).Value,
 '3': LookUp(colTemp, Id = 3).Value,
 '4': LookUp(colTemp, Id = 4).Value,
 '5': LookUp(colTemp, Id = 5).Value,
 '6': LookUp(colTemp, Id = 6).Value,
 '7': LookUp(colTemp, Id = 7).Value,
 '8': LookUp(colTemp, Id = 8).Value,
 '9': LookUp(colTemp, Id = 9).Value,
 '10': LookUp(colTemp, Id = 10).Value
 }
);


Result: When I try updating the Values I was able to do it for the 1st time then as stated in above example I was able to Patch value from 1 to 6 as '999'. But when I update 7 to 10 as '123', Then I lost the value '999' from 1 to 6 columns.

Could someone please help me with this requirement?
Thanks in advance 
@WarrenBelz 
 @LaurensM 
@Amik 

@DJ_Jamba 

Please Help

@

Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @PrudhviL ,

     

    Try below formula:

    ClearCollect(
     colTemp,
     ForAll(
     Sequence(10), // Create a sequence from 1 to 10
     {
     Id: Value,
     Value: If(
     Value(ST_1.Text) <= Value && Value(ET_1.Text) >= Value,
     Value(ValueT_1.Text),
     Blank() // If the condition is not met, store a blank
     )
     }
     )
    );
    Patch(
     TenderCosting,
     LookUp(TenderCosting, ID = Gallery1.Selected.ID),
     If(!IsBlank(LookUp(colTemp, Id = 1)),
     {'1': LookUp(colTemp, Id = 1).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 2)),
     {'2': LookUp(colTemp, Id = 2).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 3)),
     {'3': LookUp(colTemp, Id = 3).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 4)),
     {'4': LookUp(colTemp, Id = 4).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 5)),
     {'5': LookUp(colTemp, Id = 5).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 6)),
     {'6': LookUp(colTemp, Id = 6).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 7)),
     {'7': LookUp(colTemp, Id = 7).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 8)),
     {'8': LookUp(colTemp, Id = 8).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 9)),
     {'9': LookUp(colTemp, Id = 9).Value)}),
     If(!IsBlank(LookUp(colTemp, Id = 10)),
     {'10': LookUp(colTemp, Id = 10).Value)})
    );

     

    Best regards,

  • PrudhviL Profile Picture
    136 on at

    Thank you @v-jefferni 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard