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

Change status automatically with dropdownlist

Hi all,

I am building an app with powerapps and I have the following problem. I have a dropdownlist that tells me the registration status (NEW, MODIFIED, FINISHED)

By default if it is a new form, the State = "NEW" but if it is modification of that registry, the State = "MODIFIED"

 

I am using the following code but it does not work for me:

 

Set(FormModeVar;EditForm1.Mode);;
If(FormModeVar = 1;
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id: 0;
Value:"NEW"
};
ThisItem.Estado;
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id: 0;
Value:"MODIFIED"
};
ThisItem.Estado
)

 

Thank you

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Change status automatically with dropdownlist

Hi @dvalenzuela 

 

If you want to show the form's status, you don't need to set one variable.

Form.Mode is already one variable.

 

For example:

You just set the dropdown's items as this:

Filter(Table({Item:0,MODE:"EDIT"}, {Item:1,MODE:"NEW"},{Item:2,MODE:"VIEW"}),Item=Form1.Mode).MODE

FormModeStatus.gif

 

Best Regards.

Yumia

Highlighted
Super User
Super User

Re: Change status automatically with dropdownlist

Hi @dvalenzuela ,

Here is how I would tackle this:

 

Dropdown:

  • Items property:
    • ["NEW", "MODIFIED", "FINISHED"]
  • Default property:
    • If(
          frmMyForm.Mode = FormMode.New,
          "NEW",
          frmMyForm.Mode = FormMode.Edit,
          "MODIFIED"
      )

Hope this helps!

Highlighted
Helper I
Helper I

Re: Change status automatically with dropdownlist

Hi seadude, thanks for your help

 

I try with this:

If(
EditForm1.Mode = FormMode.New;
ThisItem.Estado.Value="NEW";
EditForm1.Mode = FormMode.Edit;
ThisItem.Estado.Value="MODIFIED"
)

 

but I have an error: "a record value was expected"

 

My data is in sharepoint online, with a colum called "Estado", if the register is new the status is "NEW", but if If I'm modifying that register, the status will be "MODIFIED"

 

Thanks

Highlighted
Resolver II
Resolver II

Re: Change status automatically with dropdownlist

your drowdown has 2 main settings, the datasource (items) and the default

 

the calculation you mentioned should be under default

the datasource can be something like ["new";"Modified";" Done" ]

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,601)