cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JHS2020
Helper V
Helper V

Dropdown patch value and subtract amount

Hi, I have made a overview of an order. An admin should choose what computer the employee should have, which will be a look-up column. When the computer is choosing from a dropdown, when pushing a button the computer should be subtracted from the lookup. But I cannot seem to get this to work. :S

 

This is the item of an order, where an Screen have been chosen and the amount that fits to that item

The overview of orders.PNG

The Lookup list 

 

TheStockWhereTheOverviewHasIt'sLookupFrom.PNG

This is the code that I am trying to patch to the list of number two picture

OverviewOfTheOrder.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @WarrenBelz 

Thank you so much for you help!! I am grateful! 😄 

I used this code 

SubmitForm(Form1_6); 
Navigate(Screen1); 
SubmitForm(Form2_5); 
SubmitForm(Form3); 

Patch(
   Stock,
   LookUp(
      Stock, HardwareType in DataCardValue7.Selected.Value
   ), 
   {Amount:Value(Label6.Text)-1}
)

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

HI @JHS2020 ,

I am assuming HardwareType has unique values and DataCardValue7 is the drop-down containing these values. Assuming HardwareType is a Lookup column, the below is some syntax guidance and may not be quite right, but try this 

SubmitForm(Forml_6); 
Navigate(Screenl);
SubmitForm(Form2_5);
SubmitForm(Form3); 
Patch(
   Stock,
   LookUp(
      Stock,
      HardwareType.Value=DataCardValue7.Selected.Value,
   ), 
   {Amount:Value(DataCardValue37.Selected.Value)-1}
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @WarrenBelz 

Thank you so much for you help!! I am grateful! 😄 

I used this code 

SubmitForm(Form1_6); 
Navigate(Screen1); 
SubmitForm(Form2_5); 
SubmitForm(Form3); 

Patch(
   Stock,
   LookUp(
      Stock, HardwareType in DataCardValue7.Selected.Value
   ), 
   {Amount:Value(Label6.Text)-1}
)

@JHS2020 ,

You have marked your own post as the solution?

@WarrenBelz Yes, is that wrong? There was some minor details in your solution which did not was correct. If you look at the codes there are some differences

Hi @JHS2020 ,

If my code guided you to the solution, then you have the option of also marking this.

I can only respond to the information you provide and I believe I did this. If this helps you to do the last bit from your own knowledge, then my solution may be the answer for someone else with a similar question.

 

 

Helpful resources

Announcements
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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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