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

Concat one column from two tables into one text field

Hi,

 

I have in SharePoint lists with licenses bundles and for each bundle the list of deliverables that are included. The list of deliverables is also a look-up field into another list, so no text.

 

In the PowerApps, I made a gallery in a gallery in order to show in a Label the concatenated value of deliverables, but when I try to add all of them in one field, i get blank.

 

So let's say I have 2 lists. A, B

 

List A is with my clients.

List B is with my bundles and what deliverables it includes. The column with deliverables is not text, but a lookup in another list that gives more details for each deliverable.

 

In list A, a client can have 1 or more bundles sold to them. Since each bundle has a list of deliverables, I am trying to put in one text line, all the deliverables. Like in Exchange you have distribution groups with members. It's like wanting to expand those distribution groups so I ONLY see the members of multiple DG. Same here, I want all the deliverables of a client in one list.

 

I did a primary Gallery that shows the deliverables, and in each item, I put sub-Gallery that shows the deliverables. Then I tried with ClearCollect and Concat to get the values and add them,but for some reason I get blank. 

 

If someone can help me with this that would be great. I can share the code etc 🙂 

6 REPLIES 6
Community Support Team
Community Support Team

Re: Concat one column from two tables into one text field

Hi @Adi2ro ,

Could you please share a bit more about the data structure of your List A and List B? How do you make a relationship between your List A and List B? Using LookUp field?

Could you please show more details about the another SP list the Deliverable column in your List B references values from?

Further, could you please share a bit more about the formula you used within your app?

 

I have made a test on my side, please take a try with the following workaround:

I assume that the data structure of your List A (Clients) as below:

Column Name        Column Type
----------- ----------- ClientName Single Text

the data structure of your List B (bundles) as below:

Column Name        Column Type
----------- ----------- Client LookUp (reference values from the ClientName column in List A)
Deliverable LookUp (references values from the DeliverableID column in your another SP List)

the data structure of your another SP list:

Column Name        Column Type
----------- ----------- DeliverableID Single Text
DeliverableName Single Text

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Add a Gallery (Gallery1) within your app, set the Items property to following:

ListA

Add a Gallery (Gallery2) within your app, set the Items property to following:

Filter(
         'ListB',
          Client.Value = Gallery1.Selected.ClientName
)

within above Gallery2 item, add a sub-Gallery (Gallery3), set the Items property to following:

Filter(
        'YourAnotherSPList',   /* <-- the SP List used to store details for each deliverable */
         DeliverableID = ThisItem.Deliverable.Value
)

 

In addition, if you want to concat the multiple deliverables values (e.g. DeliverableName) into a Text field, you could consider add a Label control within your Gallery2 (not within Gallery3), set the Text property to following:

Concat(
Filter( 'YourAnotherSPList', /* <-- the SP List used to store details for each deliverable */ DeliverableID = ThisItem.Deliverable.Value ),
DeliverableName & " & "
)

Please take a try with above solution step by step, then check if the issue is solved on your side.

 

More details about Concat function in PowerApps, please check the following article:

Concat function

 

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.
Adi2ro
Level: Powered On

Re: Concat one column from two tables into one text field

Hi,

 

Thanks for the detailed reply. So my problem is that in my SharePoint lists, everything is a lookup mostly. And I noticed that the app cannot dive too deep into lookups. 

 

Le me try to share more on this so:

Lists:

 

Licenses

Fields that matter: Client name (text field) / License Bundles (lookup field with multiple selections in product bundle list)

 

Product Bundles

Bundle (text field) / Product Deliverables (lookup with multiple selections in list Deliverables)

 

Deliverables

Name (text field) / Product Group (lookup in product bundles - single selection)

 

So having these three fields, for ONE client I can have 1 or more bundles + a column called "additional features that can include multiple selection of deliverables with a lookup field into deliverables list). 

 

I am tried to combine the two bundles but expanded and then also that column (but the last part I think it's easier than the first).

 

What I did is:

Gallery3.Items: 

BrowseGallery1.Selected.'Licence Bundle(s)'

- because browsergallery1 is the list with my clients. Within gallery 3 i have:

  • label.text 
    ThisItem.Value

- so i double check that the name of the bundle appears correctly

  • Gallery9.Items
Filter('Product Bundles',Title=Label10.Text)

- The above combination managed to show me for each client how many bundles I have.

 

Then in Gallery9 i have the following element:

  • Label6 with text:
Concat(ThisItem.'Product Deliverables ',Value,";")

So basically I have one gallery and one sub-gallery and the Label6 displays the concatenated text of the deliverables. I was trying to add each Label6 value in that gallery, all in one other long line, and that is where it fails. 

 

If i put a Label on the top level with text "Label6.Text" it's blank. 

 

i tried also a button:

 

Button > ClearCollect(totaldeliv2, Gallery3.AllItems.Gallery9)

 

Which makes two tables in some cases (depends on how many bundles exists), but I don't know how to basically say "For each table, get the column called "Product Deliverables" (lookup field) and make them in one line"

 

It's a combination of ForAll and Concat, but everything I make something, even tho no error, I get blank values. 

 

 

 

 

 

Community Support Team
Community Support Team

Re: Concat one column from two tables into one text field

Hi @Adi2ro ,

Based on the formula that you typed within the Label6, I think there is something wrong with it.

 

Please consider modify your formula as below:

Concat(ThisItem.'Product Deliverables', Value & ";")

Please take a try with the above formula, check if the value displayed.

 

If the issue still exists, please consider re-create a new app based on your SP lists, then try above formula again, 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.
Adi2ro
Level: Powered On

Re: Concat one column from two tables into one text field

The formula is corect as the last one is the separator. And I get a value there, it works.

 

My problem is when I try to gather all the values in each Label6 (for each item in Gallery9) and to concat them. Then it fails.

 

I think it's because I try to concat a concated value 🙂 So I am thinking, how can I get in a collection, concated values for each item in a gallery or table and then I can concat the collection 🙂

Community Support Team
Community Support Team

Re: Concat one column from two tables into one text field

Hi @Adi2ro ,

Could you please share more details about your issue?

Do you want to concatenate all values within your Gallery9 within the Label6?

 

Based on the needs that you mentioned, I think the ForAll function and Concat function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the Text property of the Label6 control to following:

Concat(
ForAll( ForAll(Gallery9.AllItems.'Product Deliverables', 'Product Deliverables'.Value), Concat(Value, Value & " ") ),
Value & " "
)

Or

Concat(
ForAll( ForAll(Filter('Product Bundles',Title = Label10.Text).'Product Deliverables', 'Product Deliverables'.Value), Concat(Value, Value & " ") ),
Value & " "
)

 

More details about ForAll function and Concat function, please check the following article:

ForAll function, Concat function

 

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.
Adi2ro
Level: Powered On

Re: Concat one column from two tables into one text field

Hi,

I believe you are correct in saying I need to combine Cocat with For All, problem is i get errors 🙂

ss1.PNG

 

Also I've replaced your "&" with ";" because my expression requires a comma "," and then a separator. 

 

However going back, the problem with the arguments is something I don't understand and that's the same issue I faced when trying to make the code myself 🙂 

 

Also if I changed something i got the first part to work, but then fails at the second:

ss1.PNG

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,283)