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 / PATCH() on a DropDownl...
Power Apps
Unanswered

PATCH() on a DropDownlist.Selected.Value

(0) ShareShare
ReportReport
Posted on by

 Hello,

I built an application on several screens, in one of these screens, let's call screen number 2, I have a drop-down list with values. I want that when a value from this list is selected, it is saved in a variable with the SET () function, then when we click on a button, the PATCH function takes care of updating a field on screen number 1 with the value from the drop-down list on screen 2.

Here is my code:

I initialize a variable VAR_travaux_EP1 with a dropdownlist selected values :

 

Set(VAR_travaux_EP1;DataCardValue225.Selected.Value)

 

then

i migrate the dropdownlistselected values in the first screen in the field : "TRAVAUXEP1essai"

Patch('Quick Check';First(Filter('Quick Check'; ID = idcourant));{TRAVAUXEP1essai:VAR_travaux_EP1})

 

I don't understand why it doesn't work... Maybe it is not possible to check dprodown list whith a patch function ?

Categories:
I have the same question (0)
  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @Anonymous ,

     

    What is the filed type for TRAVAUXEP1essai? if it is a choice filed try below:

    Patch('Quick Check';First(Filter('Quick Check'; ID = idcourant));{TRAVAUXEP1essai:{Value:VAR_travaux_EP1}})

     
    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Community Power Platform Member Profile Picture
    on at

    Thanks for your answer, @KrishnaV 

     

    I have created on my SharePoint List "QuickCheck" a choice list column called "TRAVAUXTRAVAUXEP1".

    Then, in my powerapps application, i have added the field "TRAVAUXTRAVAUXEP1".

    When i click on the button which PATCH the VARIABLE, something happens but there is not my data in the dropdown list TRAVAUXTRAVAUXEP1.

    Can you help me please ?

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Anonymous ,

     

    get the dropdown values as below

    Set items property as :

    Choices(SPListName.TRAVAUXTRAVAUXEP1)


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Helen_BB Profile Picture
    89 on at

    Hi @KrishnaV 

     

    Wonder if you can help me out, I am no longer able to patch dropdowns to my choice SharePoint field.

     

    I have tried the following as you suggested above, I get no errors but it does not get saved.

    Patch(PDP,{ID:PDPID},{'My Ambition':{Value:'SY My Ambition'.Selected.Value}});Refresh(PDP) 

     

    I have also tried 

    Patch(PDP,{ID:PDPID},{'My Ambition':'SY My Ambition'.Selected});Refresh(PDP)

    This code worked in a previous version of my app

     

    and have tried

    Patch(PDP,{ID:PDPID},{'My Ambition':'SY My Ambition'});Refresh(PDP)

     

    The default for my 'Sy My Ambition' is:

    ThisPDP.'My Ambition'.Value

     

    Items for Sy My Ambition is:

    Choices([@PDP].'My Ambition')

     

    Any idea what is wrong and why its no longer saving? 

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Helen_BB ,

     

    Sad to know that it is not working may I know do you see any error?


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Helen_BB Profile Picture
    89 on at

    Hi @KrishnaV 

     

    Thanks for getting back to me, no none of the three examples present an error, it just doesn't save to the sharepoint list.

     

    It's really strange as this code worked fine in a previous version and has only started playing up. There have been a few issues the past few weeks where things have just randomly stopped working, it's so frustrating! 

  • Helen_BB Profile Picture
    89 on at

    @KrishnaV Just to add, within the same patch when I am saving into text fields that is working perfectly fine so it is specifically to do with the dropdown and choice field and not the patch itself 🙂

  • LB-30081518-0 Profile Picture
    17 on at

    I'm trying to create a form that updates a table, 'Maintenance Master'

    In Maintenance master there is a column that is a Lookup from 'All Mast Projects'

     

    I have three form inputs:

    MainProject (dropdown populated from 'All mast Projects)

    MaintDate (Date picker)

    MaintDesc (text input)

     

    And I have a button, with the OnSelect function as follows:

    Patch ('Maintenance Masters', Defaults('Maintenance Masters'), {'Description and notes':DescText.Text,'Date Undertaken':MaintDate.SelectedDate, 'Project':
    {
    Value: MaintProject,
    Id:
    LookUp(
    'All Mast Projects',
    'Project' = MaintProject.Selected
    ).ID
    }
    })
     
    I"m getting an error, (Which seems to be impossible to copy to the clipboard), so screen-grabbed below.
    LeeBaz_0-1712835881806.png

    Any help much appreciated!

    Thanks

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard