Power Apps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
 View Only
  • 1.  Change data card DisplayMode based on multiple conditions

    Gold Contributor
    Posted Feb 17, 2022 09:13 PM
    In my Power App, users can enter their bike miles for the current month AND they have until the 5th of the following month to record miles for the current month. So I could record February miles until 3/5/22. I'm using some variables for the first condition. Property: DisplayMode Function: If(varFebMonth = varCurrentMonth, DisplayMode.Edit,DisplayMode.Disabled) I'm stuck on how to create condition to allow users to also enter miles for first 5 days of the month. See screen shot.

    I've tried adding this formula to the Feb month control, but still not working. I'm thinking there's an issue with the variables in my OnStart being "Text", but the calculation expects a number, which is why I added "Value" in the formula.

    If(varFebMonth = varCurrentMonth || (Value(varFebMonth) = varCurrentMonth-1 && varCurrentDay<6), DisplayMode.Edit, DisplayMode.Disabled)


    ------------------------------
    Beth Beck
    O365 Business Analyst
    Fort Myers FL
    ------------------------------


  • 2.  RE: Change data card DisplayMode based on multiple conditions
    Best Answer

    Posted Feb 18, 2022 02:21 PM
    If you just change your formula to Value(varCurrentDay) < 6, then your error should be gone and it should work as you expect.

    ------------------------------
    Harsh Naik
    ------------------------------



  • 3.  RE: Change data card DisplayMode based on multiple conditions

    Gold Contributor
    Posted Feb 18, 2022 02:48 PM
    Thank you! I used this in the formula and it seems to be working. No errors.
    If(varJanMonth = varCurrentMonth || Value(varCurrentDay)<6, DisplayMode.Edit, DisplayMode.Disabled)

    ------------------------------
    Beth Beck
    O365 Business Analyst
    Fort Myers FL
    ------------------------------