cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Adding data from a column in a data table to a collection

Hi All,

 

Please see the attached image of the app. I have a data table that views the data when the user selects something on a power BI report. I want to get the data from the contact id column and the data from the text fields(subject,description) into a collection when the button is clicked. I have the following code in the button but it does not work. The contact id is not getting added to the collection.

 

Collect(
DVdetails,
{
Subject: I_Subject.Text,
Description: I_Description.Text,
MyContactID: ContactID_Column3.Text
}
)

 

I want the collection as:

 

ContactIDSubjectDescription
FF388...ddddd
FF413...ddddd

 

Please help. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Adding data from a column in a data table to a collection

I resolved this using the following code. We can merge two collections together:


ClearCollect(
MySPCollection,
PowerBIIntegration.Data
);
ClearCollect(
DVdetails,
{
ID: 1,
Subject: I_Subject.Text,
Description: I_Description.Text
}
);
ClearCollect(MergeSubject,
AddColumns(MySPCollection, "Subject", LookUp(DVdetails,ID=1,Subject) )
);

ClearCollect(MergeDesc,
AddColumns(MergeSubject, "Description", LookUp(DVdetails,ID=1,Description))
)

 

View solution in original post

2 REPLIES 2
Highlighted
Frequent Visitor

Re: Adding data from a column in a data table to a collection

I resolved this using the following code. We can merge two collections together:


ClearCollect(
MySPCollection,
PowerBIIntegration.Data
);
ClearCollect(
DVdetails,
{
ID: 1,
Subject: I_Subject.Text,
Description: I_Description.Text
}
);
ClearCollect(MergeSubject,
AddColumns(MySPCollection, "Subject", LookUp(DVdetails,ID=1,Subject) )
);

ClearCollect(MergeDesc,
AddColumns(MergeSubject, "Description", LookUp(DVdetails,ID=1,Description))
)

 

View solution in original post

Highlighted
Community Support
Community Support

Re: Adding data from a column in a data table to a collection

Hi @Sindu_9090 ,

 

Thanks for sharing your resolution here and hope others could benefit from it.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,148)