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

Display form even wen no item to display

How do I display a form even when no item exists to display? Is it possible?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Display form even wen no item to display

@SkiDK 

 

Here is what you can do in this case, you can try to update the OnSelect property of your gallery item to:
 
If(IsEmpty(Filter(Table2, Field1 = ThisItem.Field1)),NewForm(Form1))
 
We are adding an if loop to check if there exists an item which satisfies the current record condition in table2, then it will create an edit form. If there is no item that exists in Table2, then a new form will be generated. Pelase replace the names used in formula with the actual names of controls
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
4 REPLIES 4
Super User
Super User

Re: Display form even wen no item to display

@SkiDK 

 

Can you please share a bit more details about the control which you are referring in your post (When no item exists)? Is it based on a Gallery or some filter?
SkiDK
Level 8

Re: Display form even wen no item to display

Hey @yashag2255 , thanks for your reply.

 

I have a gallery that shows all items from Table A, and when you press one item, it shows more detailed information in a form next to it. This data is stored in multiple items in table B (which are linked with the ID from table A).

 

Table A is full, but table B not necessarily. That means when I press on an item from A, for which are no corresponding items in B, it shows in the form 'No item to display'. My question is even though there is no item to display, how to show the form anyway but empty, instead of the message by which the form dissapears.

I want to be able to use the form to add items into table B that correspand to an item in table A, but that means I need to get access to the form. Even in Edit mode it gives the same message. Can't I just show the form without an item to fill it in?

 

I kind of found a solution, but it does not completely satisfy what I wanted to achieve. When an item in A gets made, it will automatically generate its empty corresponding items in table B, which then can be displayed in the form and edited. But as long certain items won't get used, I don't really see the point of already generating them beforehand, taking up unnecessary space and performance (especially in case when dealing with a largeamount of data).

 

Super User
Super User

Re: Display form even wen no item to display

@SkiDK 

 

Here is what you can do in this case, you can try to update the OnSelect property of your gallery item to:
 
If(IsEmpty(Filter(Table2, Field1 = ThisItem.Field1)),NewForm(Form1))
 
We are adding an if loop to check if there exists an item which satisfies the current record condition in table2, then it will create an edit form. If there is no item that exists in Table2, then a new form will be generated. Pelase replace the names used in formula with the actual names of controls
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
SkiDK
Level 8

Re: Display form even wen no item to display

@yashag2255 thanks, that's a great idea.

 

I don't want to get the edit or new form right away and I work with Patch(). Not all the data to store comes from the form. But basically it's the same idea. Only now I do:

 

If(IsEmpty(Filter(Table2, Field1 = ThisItem.Field1)),Patch(DATA))

 

Then it can automatically show in a view form as well, showing as an unedited item instead of no item. And then it only gets created when it needs to.

 

Thank you very much

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 167 members 5,496 guests
Please welcome our newest community members: