cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Power Apps collection and SharePoint MultiLine Text field

I am working on an app where I am collecting a group of data that contains 3 fields (Region, Country & Country Code).  This is collected into a collection as it may have multiple region sets.

 

MarketRegion.png

 

As a whole all the information contained in the App will be patched as a single list item in SharePoint.

 

I need to take the items in my Market collection and get them into a variable where they can then be patched as single item into the appropriate SharePoint List field.

 

It should end up looking something like this:  Antarctica, South Georgia and the South Sandwich Islands, GS; Asia, Armenia, AM; Europe, Gibraltar, GA; Africa, Madagascar, MG.   I am thinking I need to do some sort of concat/concatenate the information in some way maybe along with a forall or ......?

 

Update:  I have solved the first part of this by using a Gallery and the Concatenate formula and then a label and the concat formula.   However I need there to be a different separator between the strings like a semi-colon (;).   I get this result.   I know that I can use Match and trim to remove the extra characters at the end, but am NOT good at regex expressions. 

 

concattedstrings.png

 

I found this:  Match(Concat(Markets, Region & ", " & Country & ", " & CountryCode & "; "),"^(?<trim>.*), $").trim  but it doesn't work because of the semi-colon.   How would I modify it to remove the addtional semi-colon?

 

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @JR-BejeweledOne ,

Based on the needs that you mentioned, I think it is not necessary to use Match function (regex expressions) to achieve your needs.

 

I have made a test on my side, I think the Left function could achieve your needs, please consider take a try with the following workaround:

Left(
     Concat(
            Markets, 
            Region & ", " & Country & ", " & CountryCode & "; "
     ),
     Len(Concat(Markets, Region & ", " & Country & ", " & CountryCode & "; ")) - 2
)

 

If there are some blank records in your Markets collection, you also need to filter out them. Please modify above formula as below:

Left(
     Concat(
            Filter(Markets, !IsBlank(Region) && !IsBlank(Country) && !IsBlank(CountryCode)), 
            Region & ", " & Country & ", " & CountryCode & "; "
     ),
     Len(Concat(Markets, Region & ", " & Country & ", " & CountryCode & "; ")) - 2
)

 

After that, you could patch above formula result (Single string value) into the Multiple Lines of Text type column of a SP List Item. You may want to patch the record to your SP List using Patch function, the standard formula format as below:

Patch(
      'Your SP List',
       Defaults('Your SP List'),
       {
          Title: "xxxx",
          MultipleLineTextColumn: Left(
                                       Concat(
                                               Filter(Markets, !IsBlank(Region) && !IsBlank(Country) && !IsBlank(CountryCode)), 
                                               Region & ", " & Country & ", " & CountryCode & "; "
                                       ),
                                       Len(Concat(Markets, Region & ", " & Country & ", " & CountryCode & "; ")) - 2
                                  )
       }
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

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.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @JR-BejeweledOne ,

Based on the needs that you mentioned, I think it is not necessary to use Match function (regex expressions) to achieve your needs.

 

I have made a test on my side, I think the Left function could achieve your needs, please consider take a try with the following workaround:

Left(
     Concat(
            Markets, 
            Region & ", " & Country & ", " & CountryCode & "; "
     ),
     Len(Concat(Markets, Region & ", " & Country & ", " & CountryCode & "; ")) - 2
)

 

If there are some blank records in your Markets collection, you also need to filter out them. Please modify above formula as below:

Left(
     Concat(
            Filter(Markets, !IsBlank(Region) && !IsBlank(Country) && !IsBlank(CountryCode)), 
            Region & ", " & Country & ", " & CountryCode & "; "
     ),
     Len(Concat(Markets, Region & ", " & Country & ", " & CountryCode & "; ")) - 2
)

 

After that, you could patch above formula result (Single string value) into the Multiple Lines of Text type column of a SP List Item. You may want to patch the record to your SP List using Patch function, the standard formula format as below:

Patch(
      'Your SP List',
       Defaults('Your SP List'),
       {
          Title: "xxxx",
          MultipleLineTextColumn: Left(
                                       Concat(
                                               Filter(Markets, !IsBlank(Region) && !IsBlank(Country) && !IsBlank(CountryCode)), 
                                               Region & ", " & Country & ", " & CountryCode & "; "
                                       ),
                                       Len(Concat(Markets, Region & ", " & Country & ", " & CountryCode & "; ")) - 2
                                  )
       }
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,384)