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 / Sharepoint List: autom...
Power Apps
Answered

Sharepoint List: automatic search and replacement of elements via PowerApps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone,

I have several SharePoint lists. I want to build a menu that allows you to replace old names with new names. By clicking on a button, the Sharpepoint lists should first be filtered by the old name and then the old name should be replaced by the new one.

The following is my current code. This also works, but only for 1 element at a time. But I would like the name substitution to be carried out directly on all associated lines by clicking on the button. Unfortunately I can't get it to work...

 

TextInput3 corresponds to the old name, TextInput4 to the new name, the variable BewerteteAbteilung corresponds to the column in the sharepoint lists that contains the name.

 

 

If(
!IsBlank(TextInput4.Text) &&
!IsBlank(LookUp('Sharepointlist1'; BewerteteAbteilung = TextInput3.Text));

Patch(
'Sharepointlist1';
LookUp('Sharepointlist1'; BewerteteAbteilung = TextInput3.Text);
{ BewerteteAbteilung: TextInput4.Text }
);;

Patch(
'Sharepointlist2';
LookUp('Sharepointlist2'; BewerteteAbteilung = TextInput3.Text);
{ BewerteteAbteilung: TextInput4.Text }
);;

Patch(
'Sharepointlist3';
LookUp('Sharepointlist3'; BewerteteAbteilung = TextInput3.Text);
{ BewerteteAbteilung: TextInput4.Text }
);;
Set(Var_Haken;true);
Set(Var_Kreuz;true)
);;
Reset(TextInput3);;
Reset(TextInput4)

 

I use the German version of PowerApps. That's why , here are ;

 

Thanks in advance

Categories:
  • Verified answer
    MarkRahn Profile Picture
    1,424 Super User 2026 Season 2 on at

    Hi @Anonymous 

     

    I took a look at what you were trying to do. It is an interesting problem. While I would think that we could get Patch to work, I think you should switch to using UpdateIf.

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-update-updateif 

     

    Change your Patch from:

     

    Patch(
    'Sharepointlist1';
    LookUp('Sharepointlist1'; BewerteteAbteilung = TextInput3.Text);
    { BewerteteAbteilung: TextInput4.Text }
    );;

     

    To UpdateIf

     

    UpdateIf(
    'Sharepointlist1';
    BewerteteAbteilung = TextInput3.Text;
    { BewerteteAbteilung: TextInput4.Text }
    );;

     

     

    I did a test and it seemed to work as you needed.

     

    -Mark

    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @MarkBandR , it solved my problem! 😊

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard