web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Status of a project: T...
Power Apps
Unanswered

Status of a project: Template, Active,Closed

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I am working on an application in which a proposal gets created  what a long variety of data. Often, a user will write something, then save it and come back later to the Editform and finalise everything.

 

I have a column named "Proposal Status" for now I have it as a Choices column (but this is NOT a requirement, the crucial thing for me is to either have "Template", "Active" and "Closed".)

 

If a user finalises the proposal he/she can press on "Activate and Download PDF" at this moment I would like for the Proposal Status to change to "Active" automatically. But how do I change the dropdowns selected value (or text-DataCard or any other option) into "Active" by simply clicking that button?

 

When a project is "Active" there are two outcomes: "Won" and "Lost". So I have a second Column called "Outcomes".

 

At this moment I do not wish for the user to edit the form anymore as the PDF is send out to the customer and the result awaits.

Is there a way change the "Outcome" field to either "Won" "Lost" if I click a button in the ViewForm? I was thinking to use Patch() function and have a button called "Won" and a button called "Lost" and then patch that items Outcome-field with either. However, it is quite challenging for me to figure out how to do that.

 

So to sum up:

 

1. How do I go about changing the combobox/dropdowns chosen value by clicking a button (the "Proposal Status")

 

2. How can I change the "Outcome" to either "Won" or "Lost" through the viewform

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    Hello again @Anonymous 🙂

     

    To change the status displaying in the dropdown to active I would start by putting this code in the OnSelect property of the button.

    Set(defaultProposalStatus, "Active");
    Reset(Dropdown1);

     

    Then you can put the code as the Default property of your dropdown.

    defaultProposalStatus

     

    If you want to control what value the dropdown shows when the user gets to the screen you could put code like this in your OnVisible property of that screen.

    Set(defaultProposalStatus, "Not Active");

     

    Note: my suggestion will only work for a dropdown control, not a combobox.  Sometimes these terms are used interchangeably.

     

    Let me know if this 1st solution works and then we can focus on the next one.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    on at

    @mdevaney,

     

    How you are well! Thank you very much for your reply 🙂

     

    I think that should actually do the job. I was thinking it would be more complicated. But when I think about it, the editform will not be entered once the Proposal Status = "Active".

     

    Is there a chance you can help me with how to Patch() the Outcome-Field according to "Win" or "Lost" as well as the Proposal Status Field to be changed to "Closed"?

    I should mention that I have now changed the Proposal Field to a simple Textfield as I see no reason for it to be a dropdown since users wont interact with that field anyways.

  • mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous

    Yes, I believe its possible to do the PATCH as well.  Just figured it would be less confusing to solve one problem at a time 🙂

     

    Can you please tell me what SharePoint column type is used for each of Outcome-Field and Proposal Status Field?  Is it a Choices column or a Single Line text column?

  • Community Power Platform Member Profile Picture
    on at

    @mdevaney,

     

    Yes definitely, step by step makes things a 100x easier 🙂

    Both of the fields are simple text fields:

     

     

    PatchField1.JPG

     

     

    I have created two buttons in the ViewForm:

     

    PatchField2.JPG

     

    Kazanildi = Won

    (Ideally, when pressed: Patch Outcome-field= "Won" AND Proposal Status-field = "Closed")

    Kaybedildi = Lost

    (Ideally, when pressed: Patch Outcome-field= "Lost" AND Proposal Status-field = "Closed")

     

     

     

  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

     

    I think you could put this code in the OnSelect property of the Kazanildi button:

    Patch(
     your_datasource_name,
     LookUp(your_datasource_name, ID = id_number_here),
     {Outcome: "Won", 'Proposal Status': "Closed"}
    )
    

     

    Then put this code in the OnSelect property of the Kaybedildi button:

    Patch(
     your_datasource_name,
     LookUp(your_datasource_name, ID = id_number_here),
     {Outcome: "Lost", 'Proposal Status': "Closed"}
    )

     

    Of course, you will have to change id_number_here to reference the actual row number.  I like doing this by adding the id field as a card in the view form and making a reference like this:

    LookUp(your_datasource_name, ID = Value(DataCardValue_ID.Text))

     

    I also tend to make hide the ID field on the form by settings the Card's Visible property to

    false

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    on at

    @mdevaney,

     

    Thank you very much again.

     

    I will try and implement it first thing in tomorrow, then accept as solution if everything works as intended!

     

     

  • mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

    Of course, please take your time and let me know about any issues 🙂

  • Community Power Platform Member Profile Picture
    on at

    @mdevaney 

     

    It worked. Thank you once again!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard