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

View solution in original post

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

eka24
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

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

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (63,874)