cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Is there a way to programmatically add an empty record at the beginning of a table?

Hello,

 

Is there a way to programmatically add an empty record at the beginning of a table?

 

This is the datasource of a combobox:

 

Sort(Table, Title, Ascending)

 

I need an empty record at the top of the combobox so the user can select it.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @WebPortal ,

If you are using Title in the Combo Box, then you could do this

Patch(
   Table,
   Defaults(Table),
   Title:{""}
)
     

This should sort at the top.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

6 REPLIES 6
Super User III
Super User III

Hi @WebPortal ,

If you are using Title in the Combo Box, then you could do this

Patch(
   Table,
   Defaults(Table),
   Title:{""}
)
     

This should sort at the top.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Post Prodigy
Post Prodigy

Hi @WarrenBelz 

Actually, it is Entidades, but using the same logic:

Patch(Entidades, Defaults(Entidades), Entidade{""})

 

Returns:

"Name isn't valid. The identifier isn't recognized"

Super User III
Super User III

You can create a Collection OnStart of the App:

Collect(CollTable,{Firstvalue:""});
Collect(CollTable,Datasource)

 

Then Change your code to";

Sort(CollTable, Title, Ascending)

 

@WebPortal ,

I thought you might pick up the missing colon (free-typed) - fixed now.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @WebPortal,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Post Prodigy
Post Prodigy

@WarrenBelzThanks a lot for helping!

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.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (99,777)