Hi All,
I am new to PowerApps and struggling with the NewForm modus.
I have created an EditForm for modifying records. It has a few fields from the primary table and two dropdown boxes for related tables. My data source is an Excel sheet with several tables. My EditForm is working fine for modifying records.
But when I try to add a new record I have a few problems.
Default property of the DataCards of these fields says ThisItem.<MyField>. It is my understanding that this is cleared in FormMode.New, which makes sense. However I would like to make that conditional base on te FormMode.
So my questions are:
Form.Mode=FormMode.Edit (You can use if codintion for this)
2. Is there a better way to let dropdown boxes to the first item then setting the default property?
To avoid Default Selection, Delete the first item on your excel sheet so that it will be blank (Dropdown always default to the first item on the list
Try the above and get back if there are issues
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
Hi eka24,
Thank you. Something like
If(MyForm.Mode = FormMode.New;MyGlobalVariable;Parent.Default)
is working fine in the default porperty of that particular field.
To avoid Default Selection, Delete the first item on your excel sheet so that it will be blank (Dropdown always default to the first item on the list
Well that is the problem. The don't 😐 In my case the first item states "Select an item" but that is the same idea as a blank item. But for some reason they don't select the first item in the list.
So is it that the problem left is the dropdown?
If so then, go by what i said then insert a label above the Dropdown that says "Make a Selection".
Unfortunate, that doesnt' work. You mentioned that a dropdown always defaults to the first item on the list. That is not happning in my app. But you made me thinking. It can be caused by me, because I have changed the code in the default property. Going to check that.
Check want I meant in the Attached. Make a selection would just be in a label not part of the dropdown values.Excel Table
Hi eka24,
I am greatful for your effort for helpning me. I tried what you meant with the empty row, but that isn't the problem.
For some reaon my dropdown box doesn't select the first item. It remembers the value of the record viewed in the form before adding a new record. Maybe I have found a solution, trying that right now.
Well with a lot of try and error I figure it out myself. In the default property of the DataCardValue I put this code:
If(MyForm.Mode = FormMode.New; LookUp(Groups; GroupID = "0"; Name); LookUp(Groups; Name = ThisItem.Group; Name))
Group is the name of the field of the primary table and Groups is the list in the dropdown box. I tried to put Parent.Default in the Else branch of the statement but that doesn't work.
User | Count |
---|---|
255 | |
107 | |
85 | |
51 | |
43 |