cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stephenkln
Resolver I
Resolver I

Weird Behavior of Table from Collection

Hey guys,

 

I have the following form:

stephenkln_0-1595008643197.png

On submit, if insert to the dB is successful, the following page will show: 

stephenkln_1-1595008692394.png

As you can see, there's some weird behavior happening on the table. All the records should be on the same row, but they each have their own row. The table is populated from a collection that is generated from the LastSubmit on the form. Here is the formula I am using: 

 

ClearCollect(LastNewEmployee,Table({LastName: AddNewEmployee.LastSubmit.LastName},{FirstName: AddNewEmployee.LastSubmit.FirstName},{JobId: AddNewEmployee.LastSubmit.JobId},{HireDate: AddNewEmployee.LastSubmit.DateofHire},{SupervisorId: AddNewEmployee.LastSubmit.SupervisorId},{LocationId: AddNewEmployee.LastSubmit.LocationId}));

 

Any ideas what's wrong? Am I missing something obvious?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @stephenkln 

 

ClearCollect(LastNewEmployee,Table(
{LastName: AddNewEmployee.LastSubmit.LastName},
{FirstName: AddNewEmployee.LastSubmit.FirstName},
{JobId: AddNewEmployee.LastSubmit.JobId},
{HireDate: AddNewEmployee.LastSubmit.DateofHire},
{SupervisorId: AddNewEmployee.LastSubmit.SupervisorId},
{LocationId: AddNewEmployee.LastSubmit.LocationId}));

Each { } pair is a row of data - to submit one row encapsulate all fields in one { } pair.

ClearCollect(LastNewEmployee,Table(
{
LastName: AddNewEmployee.LastSubmit.LastName,
FirstName: AddNewEmployee.LastSubmit.FirstName,
JobId: AddNewEmployee.LastSubmit.JobId,
HireDate: AddNewEmployee.LastSubmit.DateofHire,
SupervisorId: AddNewEmployee.LastSubmit.SupervisorId,
LocationId: AddNewEmployee.LastSubmit.LocationId
}));

Hope this helps,

RT

View solution in original post

3 REPLIES 3
RusselThomas
Microsoft
Microsoft

Hi @stephenkln 

 

ClearCollect(LastNewEmployee,Table(
{LastName: AddNewEmployee.LastSubmit.LastName},
{FirstName: AddNewEmployee.LastSubmit.FirstName},
{JobId: AddNewEmployee.LastSubmit.JobId},
{HireDate: AddNewEmployee.LastSubmit.DateofHire},
{SupervisorId: AddNewEmployee.LastSubmit.SupervisorId},
{LocationId: AddNewEmployee.LastSubmit.LocationId}));

Each { } pair is a row of data - to submit one row encapsulate all fields in one { } pair.

ClearCollect(LastNewEmployee,Table(
{
LastName: AddNewEmployee.LastSubmit.LastName,
FirstName: AddNewEmployee.LastSubmit.FirstName,
JobId: AddNewEmployee.LastSubmit.JobId,
HireDate: AddNewEmployee.LastSubmit.DateofHire,
SupervisorId: AddNewEmployee.LastSubmit.SupervisorId,
LocationId: AddNewEmployee.LastSubmit.LocationId
}));

Hope this helps,

RT

@RusselThomas  I knew it had to be something simple. 😝 Thanks for the help!

eka24
Super User
Super User

Do you want to put the last Submit in the Collection;

ClearCollect(LastNewEmployee,{LastName: AddNewEmployee.LastSubmit.LastName,FirstName: AddNewEmployee.LastSubmit.FirstName,JobId: AddNewEmployee.LastSubmit.JobId,

HireDate: AddNewEmployee.LastSubmit.DateofHire,SupervisorId: AddNewEmployee.LastSubmit.SupervisorId,

LocationId: AddNewEmployee.LastSubmit.LocationId})

 

Am assuming the form name is AddNewEmployee

 

An alternative is to get the Data from the Table because it contains the submitted data;

ClearCollect(LastNewEmployee, Table1)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,414)