cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
leyburn19
Level 10

Extract text from a text variable

I have a text variable that takes the contents from a SharePoint Column.  the contents contain a group of names, seperated by a comma.  EG:  Name1, name2, name3

 

I want to go through the variable extracting the names,  then match the name to a collection that contains their email and basically create another variable with the emails.  I have a collection based on a source that lists a lot of names with the email.

 

so the objective to is extract the name from the first variable and if matches the collection puts their email into another variable.

 

hope this makes sense

4 REPLIES 4
Super User
Super User

Re: Extract text from a text variable

Hi @leyburn19

 

I think the Split function is key function that you're looking for. This function splits the comma separated list into a table. You might need to call the Trim function to remove any trailing spaces. So the call to split a comma separated list into a table would look something like this:

Trim(Split("Name1, name2, name3", ","))


Next, you can extract the rows from your SharePoint list by calling the Filter and In commands.

The call to return a table with matching rows look something like this:

Filter(SharePointListName, 
         Firstname in Trim(Split("Name1, name2, name3", ","))
)


A caveat is that this call won't be delegable.

I wasn't sure if you wanted to flatten the email address into a comma separated list but if so, you can call the Concat function to do this.

Concat(
       Filter(SharePointListName, Firstname in Trim(Split("Name1, name2, name3", ","))),
       Email & ","
)

I'm guessing that you know how to call the UpdateContext/Set functions to store the results into variables?

 

Hope that's of some help.

leyburn19
Level 10

Re: Extract text from a text variable

Thanks, I will geive all this ago. It is not likely that delagble will ever be an issue on this one. On that note the recent update to deal with delagble to 2000 on the client side is working very well
Super User
Super User

Re: Extract text from a text variable

Excellent, good luck with that!

leyburn19
Level 10

Re: Extract text from a text variable

Thanks for your help has me going in the right track,  just not there yet

 

If I use Set(name8,TrimEnds(Split(Attend1,";"))) – I get a table of names
 
I have also tried your
 
Set(Emaillist,Concat( Filter(MAtendees, Surname in Trim(Split(Attend1, ";"))), Emails & ";" )   - but this does not even create the variable
 
So it is a work in progress
 
Regards
Mark

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 95 members 3,746 guests
Please welcome our newest community members: