cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Edit mode update with static value

I have a form in my PowerApp to add/update items to a SharePoint list.  One of the fields (Status) in the list is a drop down box.  When adding a new item I just set this field using the Update property of the Status datacard (its set to {value: "Awaiting Approval"}) - all objects in the datacard have been removed and the card's visibility set to false.  This works fine.

 

However, when i change the form to Edit mode, this stops working and the value does change to my required value on SubmitForm.  I can change it using the Patch option, but this id rather avoid having to add an extra step!  Any ideas?

 

cheers

2 REPLIES 2
Super User II
Super User II

Hi @StevieC 

It is my understanding that you wish to automatically set the status datacard value when the form is in New mode but to give users the option to use a dropdown to reset the status property when the form is in Edit mode.  You currently hide the status card when the form is New but wish to show it when the form is Edit mode.  To do this you would make the following changes:

Set the Update property of the card to

 

 If(
    IsBlank(ThisItem.Status
    ), "Awaiting Approval", 
        Dropdown1.Selected.Value
  )

 

Set the Visible property of the card !IsBlank(ThisItem.Status) and the Default property of the dropdown in the card to Parent.Default.

When the form is in New mode, ThisItem.Status will be blank and the update property will save "Awaiting Approval" as the status.  Since the visible property of the card will be blank, the card will be hidden for New forms.

Once the card has been saved, when the form is put into Edit mode, ThisItem.Status will now be "Awaiting Approval" and the card will now be visible and the default property of the dropdown should show "Awaiting Approval".   Should this value of the dropdown be changed,  when the form is submitted, it will now update Status to the value in the dropdown.

Thanks for the reply, but you misunderstand slightly.  Both New and Edit mode just set the value without using a user option.  Both use {value: "Awaiting Approval"} in the Update property, but this only works for the New form, the edit form doesn't change the value.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,177)