Skip to main content

Notifications

Community site session details

Community site session details

Session Id : QhMO9k+/jNdzJULK95DF1P
Power Apps - Building Power Apps
Unanswered

It is possible to use the Substitute function to replace a part of a string in all the rows of a sharepoint list

Like (0) ShareShare
ReportReport
Posted on 8 Apr 2022 14:54:13 by

How are you, I would like to know if this is possible, what happens is that I have a field in which initially the data is taken from a combobox to text, concatenating what the user chooses with commas, the field is more or less as follows

Text1,Text2,Nancy,Andres,Pedro,Carlos,Juan,Lucia

and so several rows with different texts

I would like to know if it is possible with the function for all () to go through all the elements of the list and update this part of the string with a new name, for example, where there is only Andres in all the rows of the list, update it for Camilo

Is this possible plus the patch + substitute function for example to update only that part of the string ?

Categories:
  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 08 Apr 2022 at 17:48:53
    Re: It is possible to use the Substitute function to replace a part of a string in all the rows of a sharepoint list

    @Anonymous 

    Yes, but your statement implies using the ForAll incorrectly.  ForAll is a function that returns a table - it is not a for loop function.

     

    So, your ultimate formula would be similar to the following:

    Patch(yourDataSource,
     Filter(
     ForAll(yourDataSource,
     If("Andres" in yourColumnName,
     {ID: ID,
     yourColumnName: Substitute(yourColumnName, "Andres", "Camilo")
     }
     )
     ),
     !IsBlank(ID)
     )
    )
     

    In the above, the ForAll creates a table to pass to the filter (in order to remove blank records based on the If statement) which then returns the table of records to "fix" for patch.

     

    I hope this is helpful for you.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 177 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 99

#3
stampcoin Profile Picture

stampcoin 80

Overall leaderboard
Loading started