web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need Help adding to a ...
Power Apps
Unanswered

Need Help adding to a Collection

(0) ShareShare
ReportReport
Posted on by 194

I'm working on an app that is close but I can't figure this last part out:

 

1.) getting data from my SP list by ID and extracting a column value:

Set(varMaterials, LookUp(
WriteUps,
ID = 37
).materialCollection);

 

## the raw data from the SP List item column looks like this: CU|234|2.34;NI|211|12.3; ##

 

2.) On button press I'm getting this data and adding it to a collection. It's adding it in the proper way except for three of the columns (for which I'm splitting data) is getting added as a table inside of my collection. I just want it to appear as plain text.

Code:

Set(varSplitItems,Split(varMaterials,";"));ForAll(varSplitItems,If(!IsBlank(Value),Collect(materialCollection,{Material:First(Split(ThisRecord.Value,"|")),Price:Last(Split(ThisRecord.Value,"|")),Weight:Index(Split(ThisRecord.Value,"|"),2),semiColonVal:";",showEdit: true })));

 

Can someone help me identify what I'm doing wrong?  Thanks!

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    152,847 Most Valuable Professional on at
    Re: Need Help adding to a Collection

    Hi @dbro ,

    Try this for all the code

    With(
     {
     wMat:
     Split(
     LookUp(
     WriteUps,
     ID = 37
     ).materialCollection,
     ";"
     )
     },
     ForAll(
     Filter(
     wMat,
     !IsBlank(Value)
     ) As aMat,
     Collect(
     materialCollection,
     {
     Material:
     First(
     Split(
     aMat.Value,
     "|"
     )
     ).Value,
     Price:
     Last(
     Split(
     aMat.Value,
     "|"
     )
     ).Value,
     Weight:
     Index(
     Split(
     ThisRecord.Value,
     "|"
     ),
     2
     ).Value,
     semiColonVal: ";",
     showEdit: true 
     }
     )
     )
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • dbro Profile Picture
    194 on at
    Re: Need Help adding to a Collection

    Thanks for the quick Reply @WarrenBelz .  I'll give this a whirl tomorrow and report back.

     

     

  • dbro Profile Picture
    194 on at
    Re: Need Help adding to a Collection

    Awesome. TYVM. Worked perfectly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard