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
Frequent Visitor

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
Frequent Visitor

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

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 Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (52,536)