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
Super User III
Super User III

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
Super User III
Super User III

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

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,541)