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

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

Super User III
Super User III

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
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.

Top Solution Authors
Top Kudoed Authors
Users online (60,576)