Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Update Status Column based on Date Selection and Text Input

(2) ShareShare
ReportReport
Posted on by 281
Hello,
 
I have below fields into form:
Group Column - consists of 2 dropdown (Group 1 and Group 2)
Invoice Date - Date Field
Invoice No - Text Input
Status - Text input
 
Below is my requirement:
  • If Invoice No is entered, update the text as Completed else Pending in Status column
  • If Invoice Date is entered, update the text as Completed else Pending in Status column
On Default property of Status column (which is DataCardValue10), I'm using below formula, but the status is always showing as Pending
If(Len(DataCardValue4.Text)=0,"Pending","Completed", If(IsBlank(DataCardValue15.SelectedDate),"Pending", "Completed"))
DataCardValue4 is Invoice No.
DataCardValue15 is Invoice Date.
 
Please advise with the correct formula. Thanks!
  • Prem4253 Profile Picture
    Prem4253 281 on at
    Update Status Column based on Date Selection and Text Input
     
    My dropdown is in the form named as drpbusiness, which has 2 options i.e. Group 1 and Group 2.
     
    I'm putting the expression into Default property of the Status Field (which is a text Input)
     
    For New button, below expression is added for OnSelect Property: (FormInspection is name of the form)
    ResetForm(FormInspection);NewForm(FormInspection);
    And for Submit button below expression is added:
    SubmitForm(FormInspection);
    Notify ("Please make sure all fields are filled in correctly ",NotificationType.Error,3000)
    Now when I click New button and select Group 1 from the drop down (drpbusiness), the status automatically shows Completed, though we have not entered Invoice No.
  • Mark Nanneman Profile Picture
    Mark Nanneman 981 on at
    Update Status Column based on Date Selection and Text Input

    Is the Dropdown you're trying to work on a control you added to the app, or is it in a Form?  What's the name of the dropdown you're editing?

    Which property are you putting the expression into.
  • Prem4253 Profile Picture
    Prem4253 281 on at
    Update Status Column based on Date Selection and Text Input
     
    It should be a simple logic, but not able to fix this from last 1 day
     
    If my - DataCardValue4 has any text / value -  than return text as Completed in DataCardValue10
     
    Similarly
     
    If my - DataCardValue15 has a date -  than return text as Completed in DataCardValue10
     
    I tried with below logic, but no luck. Every time something strange is happening with the formula.
    If(!IsBlank(DataCardValue4.Text),
     "Completed", "Pending",
     !IsBlank(DataCardValue15.SelectedDate),
     "Completed",
     "Pending"
    )
    And suggestions would be appreciated a much.
  • Prem4253 Profile Picture
    Prem4253 281 on at
    Update Status Column based on Date Selection and Text Input
     
    Thanks! working as Expected but only for the existing records which are entered.

    But when I click New (to add a new item) and if  Group 1 is selected from the drop down, the status automatically shows Completed, though we have not entered Invoice No.
  • Verified answer
    Mark Nanneman Profile Picture
    Mark Nanneman 981 on at
    Update Status Column based on Date Selection and Text Input
    I would probably need to see a screenshot of your power app to completely understand what you're trying to do.  If "Group Column" is a Drop down with "Group 1" or "Group 2" as items and you want that incorporated in your logic just update what I gave you before.

    It could look something like:
    If(
    (GroupDropDown.Selected.Value = "Group 1" And DataCardValue4.Text <> "") Or 
    (GroupDropDown.Selected.Value = "Group 2" And !IsBlank(DataCardValue15.SelectedDate)),
    "Completed",
    "Pending"
    )


     
  • Prem4253 Profile Picture
    Prem4253 281 on at
    Update Status Column based on Date Selection and Text Input
     
    Does not seems to work as expected. All of the status are changing to Completed using your formula.
     
    Can you please advise with another logic as:
     
    1. If Group 1 is selected from Group dropdown, and it has a Invoice No. (Invoice Date can be blank), update the text as Completed else Pending
    2. If Group 2 is selected from Group dropdown, and it has a Invoice Date (Invoice No. can be blank), update the text as Completed else Pending
     
  • Suggested answer
    Mark Nanneman Profile Picture
    Mark Nanneman 981 on at
    Update Status Column based on Date Selection and Text Input
    If Pending is your default (what you want it to be if the condition isn't met) and you want it to show Completed if you have an invoice number OR you have a invoice date, try this:

    If(DataCardValue4.Text <> "" Or !IsBlank(DataCardValue15.SelectedDate),
    "Completed",
    "Pending"
    )

    If this helps, please give it a like and mark it as an answer!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard