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

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?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
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
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,969)