Hi all,
I have a Powerapps form with a "Status" field, this field has 5 values as linked from a Sharepoint choice field in a list which is linked to the form. If I set the field to Editable I can correctly manually select all the choices, so I know the linkage is working. I have the following code set in "Default" status of the field :
If(
Request.Mode = FormMode.New,
{Value: New},
{Value: ThisItem.Status}
)
Despite this on loading the app the field remains empty.
Any ideas what I'm doing wrong? Quite new to PowerApps so likely something stupid I've missed.
Hi @WarrenBelz ,
I don't see any option for DefaultSelectedItems in my combobox Advanced properties, however on some digging around the place I found this under the DataCardValue value section of this drop down box. With the change from @AmDev above applied to the code in this box this is now working fine. Thanks both.
Hi @Powertron ,
Assuming
That code looks correct to me. Are either of these untrue ?
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.
Visit my blog Practical Power Apps
Hi,
I have changed the code to what you've said, however the box remains the same, i.e no value on load.
The code indicates there are no issues but when opening the form in newform mode the box has no value.
Thanks,
Fraser
Hi @Powertron ,
If that is a Combo Box, your code needs to be in the DefaultSelectedItems, not the Default.
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.
Visit my blog Practical Power Apps
Hi @Powertron
Assuming this is the 'Default' property in the datacard for your status field and your Form is called 'Request' - Also, for a new form, you want the Status to = "New".
If my understanding is correct, please try with the following tweak to add " around your New text. This ensures Power Apps reads it as text.
If(
Request.Mode = FormMode.New,
{Value: "New"},
{Value: ThisItem.Status}
)
Hope this helps
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.