cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

PATCH() on a DropDownlist.Selected.Value

 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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
KrishnaV
Community Champion
Community Champion

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.


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,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

7 REPLIES 7
KrishnaV
Community Champion
Community Champion

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.


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,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Anonymous
Not applicable

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 ?

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.


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,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

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? 

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.


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,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

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! 

@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 🙂

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,668)