cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dvalenzuela
Level: Powered On

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
Community Support Team
Community Support Team

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

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!

dvalenzuela
Level: Powered On

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

Sijts
Level 8

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
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,408)