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

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

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

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 Team
Community Support Team

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,393)