cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,427)