cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dvalenzuela
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
v-yuxima-msft
Community Support
Community Support

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

seadude
Memorable Member
Memorable Member

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!

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

Anonymous
Not applicable

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,937)