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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to make a dropdown...
Power Apps
Answered

How to make a dropdown display UK date format but still have my patch formula work?

(0) ShareShare
ReportReport
Posted on by 60

This is actually mad. I've managed to change the date format on the Power App Table to UK however still Power Apps views these date fields in US format!

 

Right now I have the whole thing working with US dates. The idea is you choose a date from the drop down then you click the button to increase that quantity by 1. The table has duplicate barcodes with specific expiry dates. The purpose of the pie graph reading the table is instant feedback what the quantity has changed to

 

This is the drop down formula. Which does not try to change the 'Expiry Date' field using Text or anything because then the button stops working. The intellisense is showing the dates are in format value: 9/15/2022, 12:00:00 AM

Sort(Distinct(Filter(Filter('Quantity-Expiry Counts',Barcode=DataCardValue1.Text),Quantity>0),'Expiry Date'),Value,SortOrder.Ascending)

How can I change the drop down to UK format and change the patch formula so it keeps working?

 

I've tried a lot of data types and even if(a=b on the drop down selected value and a text field if solving the format allows the patch formula to work, it doesn't or daisy chaining things together.

 

If anyone's wondering how I got the pie chart to show 2 fields, that is actually 2 pie charts on top of each other.

 

Here is the Patch formula behind the green add one quantity button.

Patch(
'Quantity-Expiry Counts',
LookUp(
'Quantity-Expiry Counts',
Barcode = DataCardValue1.Text && 'Expiry Date' = DateValue('Dropdown Raw'.SelectedText.Value, "en-US")
),
{
Quantity: LookUp(
'Quantity-Expiry Counts',
Barcode = DataCardValue1.Text && 'Expiry Date' = DateValue('Dropdown Raw'.SelectedText.Value, "en-US")
).Quantity + 1
}
)

Edit: 

I have finally spotted exactly what is going wrong according to the intelisense:

DateValue('Dropdown Raw'.SelectedText.Value, "en-US")

When the dropdown is in UK format mode, this formula is not moving the day-month values back to their positions. so 09/03/2023 (dd/mm/yyyy) stays 09/03/2023 as (mm/dd/yyyy) which is a valid date in both formats and 15/03/2023 (dd/mm/yyyy) gets converted into 15/03/2023 (mm/dd/yyyy) which errors and shows a random valid date from the table in the intellisense instead.

Capture.PNG

Categories:
  • Verified answer
    Tardisgx101 Profile Picture
    60 on at
    Patch(
        'Quantity-Expiry Counts',
        LookUp(
            'Quantity-Expiry Counts',
            Barcode = DataCardValue1.Text && 'Expiry Date' = DateValue('US-M'.Text&"/"& 'US-D'.Text&"/"& 'US-Y'.Text, "en-US")
        ),
        {
            Quantity: LookUp(
                'Quantity-Expiry Counts',
                Barcode = DataCardValue1.Text && 'Expiry Date' = DateValue('US-M'.Text&"/"& 'US-D'.Text&"/"& 'US-Y'.Text, "en-US")
            ).Quantity + 1
        }
    )
     
    I have solved it 😎 I had to do a really dumb breaking the UK date field up and reconstructing the value in the order (mm/dd/yyyy). But it works so yey. These are text labels I will set to hidden.
     
     
    Month:
    Mid('Dropdown Raw'.SelectedText.Value,4,2)
     
    Day:
    Left('Dropdown Raw'.SelectedText.Value,2)
     
    Year:
    Right('Dropdown Raw'.SelectedText.Value,4)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard