cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bgr0511
Level: Powered On

Comparing Strings in Collection against SharePoint Multi line values

Hello PowerApps Community,

 

Is there any way to Compare a list of collection items against SharePoint MultinLine text value in PowerApps?

 

Here is my scenario, I have a sharePoint multi-line column with multiple lines of names and I'm trying to compare the column with

a Collection of names entered by the user in PowerApps. Do I need to use flow or can this be done in PowerApps? Thank you!

 

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Comparing Strings in Collection against SharePoint Multi line values

Hi @bgr0511,

 

Could you please share a bit more about your scenario?

How do you want to compare the multi-line type column with the Collection of names within a PowerApps app?

 

If you want to compare the multiple lines of text type column within a Collection of names within an app, please make sure that you have turned on/enabled the "Use enhanced rich text (Rich text with pictures, tables and hyperlinks)" option for the Multiple lines of text type column as below:3.JPG

 

After that, you could split the Multiple lines of text type column value into a table value using Split function, and then you could compare the table value with a Collection within your app.

 

I have created a SP list on my side, the data structure as below (only have one item):4.JPG

Note: The EmployeeNames is a Multiple lines of text type column, which has enabled the "Use enhanced rich text (Rich text with pictures, tables and hyperlinks)" option.

 

In order to split a Multiple lines of Text type column value (of the first item) into a Table value, add a Data table control within the screen of my app, set the Items property to following formula:

Trim(Split(Substitute(Substitute(First('20180823_case9').EmployeeNames,"<div>",""),"</div>",""),"<br>"))

The Table value shows up as below:6.JPG

 

Add a Button control (Called "Add Collection") within the screen of my app, set the OnSelect property of the Button control to following formula:

ClearCollect(
Collection1,
{Name:"Kris Dai",IsExisted:""},
{Name:"Steven",IsExisted:""},
{Name:"Teresa",IsExisted:""},
{Name:"Eric",IsExisted:""}
)

The Collection shows up as below:5.JPG

 

I assume that you want to compare the Table value within the Collection value within an app, if the Name within the Collection has been existed within the Table value, set IsExisted field to true, otherwise, set IsExisted field to false.

 

 

Add a "Compare" button within the screen of my app, set the OnSelect property of this Button control to following formula:

ForAll(
RenameColumns(Collection1,"Name","Name1"),
If(
!IsBlank(LookUp(Trim(Split(Substitute(Substitute(First('20180823_case9').EmployeeNames,"<div>",""),"</div>",""),"<br>")),Result=Name1)),
UpdateIf(Collection1,Name=Name1,{IsExisted:true}),
UpdateIf(Collection1,Name=Name1,{IsExisted:false})
)
)

The Collection would show up as below after clicking the "Compare" button:7.JPG

 

Note: The "20180823_case9" represents the SP list data source within my app.

 

The whole screenshot as below:

8.JPG

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bgr0511
Level: Powered On

Re: Comparing Strings in Collection against SharePoint Multi line values

Hey Kris, I followed the step by step process but the data table result gives me a html instead of the record values of the column. See the attached screenshots. Am I doing something wrong?

 

Regards,

bgr0511

Community Support Team
Community Support Team

Re: Comparing Strings in Collection against SharePoint Multi line values

Hi @bgr0511,

 

Just an update -- It is my fault, I have made a test on my side, the issue is confirmed on my side.

 

I afraid that there is no way to achieve your needs in PowerApps currently. If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 434 members 5,411 guests
Please welcome our newest community members: