cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
stapes
Level 8

How do I add a field to an existing collection so that I can see it in my canvas app?

I have an existing app with a gallery using data from a flow.

I wanted to add an extra field to my gallery. I have added the field to my stored procedure, and I have edited the flow, and the response body.

When I return to the app, it cannot see the new fields.

I am getting the data in the OnVisible action of the screen:

 

ClearCollect(outstandingOrders,GoodsInToday.Run(gvWeekNo, gvSelectedYear, gvDaySelected)
);

 

Using the menu, File > Collections > I can see my new field is not here.

I can understand that ClearCollect only deletes the existing data from the Data Table but it does not recreate the table.

How do I force it to find my new field?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
stapes
Level 8

Re: How do I add a field to an existing collection so that I can see it in my canvas app?

Solved my own problem. Collect(outstandingOrders,GoodsInToday.Run(gvWeekNo, gvSelectedYear, gvDaySelected)
); did the trick!

View solution in original post

6 REPLIES 6
Super User
Super User

Re: How do I add a field to an existing collection so that I can see it in my canvas app?

@stapes 
A collection must have the same columns in all instances. 

 

What i mean by this is outstandingOrders cannot have columns [gvWeekNo, gvSelectedYear, gvDaySelected] somewhere in your code then [gvWeekNo, gvSelectedYear, gvDaySelected, newColumn] in another.

The trick here might be to include newColumn in your initial column but fill it with Blank() until it is used.

AddColumns(outstandingOrders,"newColumn",Blank())

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

stapes
Level 8

Re: How do I add a field to an existing collection so that I can see it in my canvas app?

Thanks mdevaney. You are not quite getting it. I want to add a column to my DataTable. This is a DataSource for a Gallery.

The Data is coming from a Flow. The new column has been added to the flow response.

 

You have written: A collection must have the same columns in all instances. 

 

That is precisely my problem. I want to redesign my collection by adding an extra field - permanently. I want to be able to see it in my Gallery. Should not be too hard.

 

Failing that - I will just have to start a new collection and a new Gallery. Seems a bit crap if I have to rebuild the whole lot from scratch.

 

stapes
Level 8

Re: How do I add a field to an existing collection so that I can see it in my canvas app?

Solved my own problem. Collect(outstandingOrders,GoodsInToday.Run(gvWeekNo, gvSelectedYear, gvDaySelected)
); did the trick!

View solution in original post

Super User
Super User

Re: How do I add a field to an existing collection so that I can see it in my canvas app?

@stapes 

I'm glad you were able to solve the problem 🙂

 

I think there is a difference in our terminology and it led to some confusion.  To me:

  • Field means Column
  • Record means Row

 

I thought you wanted an additional column here 😿

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

stapes
Level 8

Re: How do I add a field to an existing collection so that I can see it in my canvas app?

@mdevaney - nope - same terminology. Lost in translation.

Super User
Super User

Re: How do I add a field to an existing collection so that I can see it in my canvas app?

@stapes 

Agreed.  But the important thing is... problem solved!

 

Go ahead and mark your own post as solution so everyone knows we've nailed it.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,726)