cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Concat function not returning expected value

Hello,

 

I have been struggling with this one all morning.

I managed to pull out the core piece of code that is producing the unexpected results.

 

I have a label control that has this code as it's "Text" property:

 

 

Concat(colUsers_WW_with_Office, mail & "##" & displayName & "##" & jobTitle & "##" & givenName & "##" & surname & "##" & officeLocation, "$$$")

 

 

 

 

This code combines all column values of all records in the "colUsers_WW_with_Office" collection into a single string value that looks like this:

"User1@domain1.com##User1##Senior Bobo##User1##Sample##Clarkson$$$User2@domain2.com##User2##Junior Bobo##User2##Sample##Clarkson"
This is expected.

 

The issue comes into play when I ask the Concat function to use a string value from single-columned table as an additional element to combine into the string, like so:

 

 

Concat(colUsers_WW_with_Office, mail & "##" & displayName & "##" & jobTitle & "##" & givenName & "##" & surname & "##" & officeLocation & "##" & First(businessPhones).Value, "$$$")

 

 

This code is exactly the same as the first, except I have added "First(businessPhones).Value" at the end.

In this case, the Concat function returns no value at all.

 

The "First(businessPhones).Value" code is using the First function to look through a table that has only a single column in it, named "Value" and return the data in that field.

Because this produces a string value, I reasoned that the Concat function would not have an issue adding this string into the list of strings to concatenate.

 

Know what I am missing?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Regular Visitor

Re: Concat function not returning expected value

Thanks to @Drrickryp, I got the guidance I needed to dig deeper into the Concat/Concatenate functions.

I believe I was able to resolve my issue by modifying the original code:

Concat(colUsers_WW_with_Office, mail & "##" & displayName & "##" & jobTitle & "##" & givenName & "##" & surname & "##" & officeLocation & "##" & First(businessPhones).Value, "$$$")

to this:

Concat(colUsers_WW_with_Office, Concatenate(mail, "##", displayName, "##", jobTitle, "##", givenName, "##", surname, "##", officeLocation, "##", Concat(businessPhones, Concatenate(Value, "##")), "$$$"))

The net result of this change is that the new code adds an inner Concatenate function that adds the simple string values that need to be added, one of which is a Concat function that references the businessPhones table and returns the first value in it.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Concat function not returning expected value

Hi @TechieJones 

I think you want to concatenate another value on to the list of strings produced by Concat()

 

Concatenate(Concat(colUsers_WW_with_Office, mail & "##" & displayName & "##" & jobTitle & "##" & givenName & "##" & surname & "##" & officeLocation, "$$$"),"##", First(businessPhones).Value, "$$$")

 

Concat works with one table and since your BusinessPhones  is another table, it doesn't get it.  Check out the differences between Concatenate() and Concat() functions in PowerApps. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-concatenate 

Highlighted
Regular Visitor

Re: Concat function not returning expected value

Hi @Drrickryp,

 

You may be on to something with the nested Concatenate/Concat combos, but we are not quite there.

 

Your code fails on two points:  one is that the business phone would be tacked on to the very end of the entire string produced by the inner Concat, where I need it to be tacked on to the end of every record within the inner Concat.  The other is that the "businessPhones" table is actually a column within the "colUsers_WW_with_Office" collection, so you cannot reference it from outside the inner Concat.

Highlighted
Regular Visitor

Re: Concat function not returning expected value

Thanks to @Drrickryp, I got the guidance I needed to dig deeper into the Concat/Concatenate functions.

I believe I was able to resolve my issue by modifying the original code:

Concat(colUsers_WW_with_Office, mail & "##" & displayName & "##" & jobTitle & "##" & givenName & "##" & surname & "##" & officeLocation & "##" & First(businessPhones).Value, "$$$")

to this:

Concat(colUsers_WW_with_Office, Concatenate(mail, "##", displayName, "##", jobTitle, "##", givenName, "##", surname, "##", officeLocation, "##", Concat(businessPhones, Concatenate(Value, "##")), "$$$"))

The net result of this change is that the new code adds an inner Concatenate function that adds the simple string values that need to be added, one of which is a Concat function that references the businessPhones table and returns the first value in it.

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,205)