cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StephenGW
Post Patron
Post Patron

Concat for Gallery

I have a SP list with 5 columns Sort Findings 1, 2, 3, ect that I want to join into one gallery and then split into separate gallery items. First I filtered the data source to only get the item I want. Then I tried to join them all together and split but it's giving me an error on the Concat of "Invalid argument type. Expecting one of the following: Text, Number, Date, ect" and "Unexpected characters, characters are used in the formula in an unexpected way." The columns of data in the SP list are multi line text and only separated by a comma.

 

Filter(
       Split(
             Concat(
                     Filter('List Name', ID = 2),
                     If(!IsBlank('Sort Findings 1'), 'Sort Findings 1', Blank()) & "," &
                     If(!IsBlank('Sort Findings 2'), 'Sort Findings 2', Blank()) & "," &
                     If(!IsBlank('Sort Findings 3'), 'Sort Findings 3', Blank()) & "," &
                     If(!IsBlank('Sort Findings 4'), 'Sort Findings 4', Blank()) & "," &
                     If(!IsBlank('Sort Findings 5'), 'Sort Findings 5', Blank()) & "," &
                  ),
             ","
       ),
       !IsBlank(Result)
)

 

Anybody have any ideas why this is happening? I have used a similar formula in a different app with no problems. Is it the multi line? What can I do differently?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@StephenGW 

You have an extra ampersand than you need.  Formula should be changed to the following:

Filter(
       Split(
             Concat(
                     Filter('List Name', ID = 2),
                     'Sort Findings 1' & "," &
                     'Sort Findings 2' & "," &
                     'Sort Findings 3' & "," &
                     'Sort Findings 4' & "," &
                     'Sort Findings 5'
                  ),
             ","
       ),
       !IsBlank(Result)
)

You don't need the If statements!  You are checking to see if something is Blank and if it is, then you are returning a Blank....well, it already is blank!!  So the above will yield the same results without all the extra typing.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@StephenGW 

You have an extra ampersand than you need.  Formula should be changed to the following:

Filter(
       Split(
             Concat(
                     Filter('List Name', ID = 2),
                     'Sort Findings 1' & "," &
                     'Sort Findings 2' & "," &
                     'Sort Findings 3' & "," &
                     'Sort Findings 4' & "," &
                     'Sort Findings 5'
                  ),
             ","
       ),
       !IsBlank(Result)
)

You don't need the If statements!  You are checking to see if something is Blank and if it is, then you are returning a Blank....well, it already is blank!!  So the above will yield the same results without all the extra typing.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Thank you! I starred at it for 30 minutes probably and didn't even notice the extra ampersand! Bonus you shortened it for me too!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,470)