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

2 Collect Statements for only 1 collection row

Hello everybody,

I've been trying to store content from multiple Collect commands in the same row of a table for some time now. Unfortunately the entries are qritten in diffrent rows.

I used statements like:

Collect(
    Cache,
    {
        CustomerNo: input_custno.Text,
        CustomerName: input_custname.Text,
        ContactPerson: input_contact.Text,
        ProjectNo: input_prono.Text,
        OrderedBy: input_ordered.Text,
        CheckedBy: input_checked.Text,
        DateBegin: date_begin.SelectedDate,
        DateEnd: date_end.SelectedDate,
        FaultType: dropdown_faulttype.SelectedText,
        Priority: dropdown_prio.SelectedText
    }
)

I also tried Statements like 

ClearCollect

and stuff like that.

Collectionbad.PNG

[this is how it looks like]

 

Can anyone help me with that?

 

best regards Jonas

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: 2 Collect Statements for only 1 collection row

Hi @JonasH 

 

Do you have separate expressions for adding these values? I mean first expression to add the values getting populated in first row and second expression with the values added in second row?
 
Collect() create a new line in the collection and it won't merge the results until done with an expression.
 
If you wish to edit the records in a existing row in the collection, then you might need to use the Patch() for the second expression instead of Collect() (This creates a new row). Here, you will need an identifier to recognize the specific row and update it.
 
Second Expression: 
Patch(Cache, LookUp(Cache, Name = "Value1"),{Col1:"Value2",Col2:"Value3"})
 
If this differs, please share the set of expressions used by you, so that we might be able to help you better.
 
Hope this helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
2 REPLIES 2
Super User
Super User

Re: 2 Collect Statements for only 1 collection row

Hi @JonasH 

 

Do you have separate expressions for adding these values? I mean first expression to add the values getting populated in first row and second expression with the values added in second row?
 
Collect() create a new line in the collection and it won't merge the results until done with an expression.
 
If you wish to edit the records in a existing row in the collection, then you might need to use the Patch() for the second expression instead of Collect() (This creates a new row). Here, you will need an identifier to recognize the specific row and update it.
 
Second Expression: 
Patch(Cache, LookUp(Cache, Name = "Value1"),{Col1:"Value2",Col2:"Value3"})
 
If this differs, please share the set of expressions used by you, so that we might be able to help you better.
 
Hope this helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
JonasH
Level: Powered On

Re: 2 Collect Statements for only 1 collection row

Thanks for your fast reply @yashag2255,

 

I found out about 1. 5 hours ago that another solution was more suitable for my purposes.

I've just tried to test your suggested solution so I can mark it as a solution, but I'd still have to create the columns for it. Currently I don't have time to understand how the AddColumn Expression works, so I assume that your solution works and mark it as a solution.

 

Thank you so much for your help.

Have a nice day ^-^ 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 297 members 3,957 guests
Please welcome our newest community members: