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 / Auto populate status f...
Power Apps
Answered

Auto populate status field on click of button

(0) ShareShare
ReportReport
Posted on by 138

Hello Everyone,

My power app is based on two Sharepoint lists Submit form and Approve form.

When Users submit forms the form, the status (Choice field) is displayed as new, and can check their status of them.

 

Need to show them the comments based on approval/rejected status.

The comments should obviously be linked to the specific form but saved on a different list.

 

Submit Lists has the following columns:

ID, Title,category,  Description, Status,Approver/Rejected comments etc....

 

Approve form has the following columns:

ID, Item Status(Choice field), Comments                                                                                                                                                     

Now, to give you an idea of the layout, I have two separate forms, Submit form and approve form(where this form inputs should be same as submitting a form) with reference ID is the field used at approver form.

Now my issue is when a form is submitted the status display is NEW---but when it is an approved form the Status should be displayed as pending. Once the Approver --Approves/reject the status should get updated as approved or rejected and the comments given should get reflected in the submit form.

 

I have tried Something Using this way, don't know it's the correct way in power app.

To try i have created a test Screen and test form --with Title and Status(Choice field)...Now When a user created a record at that time the status field Should be New...ON Click of Submit button --the Status value should get changed to pending approval.

Salesforce_0-1647966538118.png

This is the formula previously I have used on DatacardValue of the status field on DefaultSelectedItems--property. The value of the status field was displaying as NEW but didn't get changed and didn't get updated in the SharePoint list.

If(
SubmitForm1.Mode = New,
LookUp(
Choices(SubmitList.Status),
Value = "New"
),
Parent.Default
)

Then I have Used an alternative way for where the status field value is getting changed in powerapp but not in sharepoint list

On DefaultSelectedItems property -Var2 is variable created, On Status Datacard value.

On Select Property Of Save Button --

Set(
Var2,
Filter(
Choices(SubmitList.Status),
Value = "Pending Approval"
));

 

On Click Of Approve/Reject button --it's changing the status value in power app but not getting updated in SharePoint

Salesforce_1-1647967006058.pngSalesforce_2-1647967038060.png

Can anyone help me out or suggest the one I'm using is the correct one or else any other way is applicable.

Any Help is very much appreciated. Thank you in Advance.

 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Salesforce 

    Since you are using a combobox (and not a dropdown), you need to be using the DefaultSelectedItems (DSI) property of the control (not the Default as it does nothing).  Not that you are not using the DSI, just wanted to re-state it to remember and for others that might be viewing this post.

     

    You don't need to do lookups for the choice to be set, you can set your DSI property to:

    Coalesce(
     Parent.Default, 
     {Value: "New"}
    )

     

    Change your formulas on the Approve and Reject to this:

    Set(varStatus, "Approved");
    SubmitForm(yourForm)

    (I assume you want to submit the form once they click on Approved or Reject)

    Do the same formula for the Reject button, but change the text to Reject.

     

    In your OnSuccess action of your form, add the following function:  Set(varStatus, Blank())

     

    Then, in the Update property of your Status datacard, change the formula to the following:

    If(IsBlank(varStatus), 
     yourCombobox.Selected,
     {Value: varStatus}
    )

     

    I would consider disabling the combobox so the user will not interact with it directly as it seems to be logic driven and not user driven.

     

    I hope this is helpful for you.

  • swchandr Profile Picture
    Microsoft Employee on at

    Yes it is correct.

     

    I think instead of content approval, you should create a custom column called status. Then you can use approval action to send approve card to approver and based on the approver, update the approval status 

     

    ================

    Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below

  • Salesforce Profile Picture
    138 on at

    Hi @RandyHayes ,

    Thanks a lot.It's working.Appreciate your help

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard