cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,027)