cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sindu_9090
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
Sindu_9090
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
Sindu_9090
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

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
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (8,424)