cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CrashData
Frequent Visitor

Expected type error on Choices Dropdown

Good day Everyone

 

I have a column in my dataverse table CIG_Databases called Technician 1 appointed, this column is populated using choices options called Technician appointed. I have a gallery set up in power apps that I would like to patch to update the selection.

 

The gallery uses a dropdown with the Item = Choices(CIG_DataBases.'Technician 1 appointed '), with the patch as follows:

ForAll(Filter(AssignTechTable.AllItems,
Tech1toggle.Value = true),
Patch(CIG_DataBases,
ThisRecord,
{'Technician 1 appointed ': Tech1Dropdown.Selected ,
'Technician appointed date': Now()}))

 

The patch fails due to the section in bold with the error The type of this argument "Technician appointed" does not match the expected type 'Table". Found type "Record".

 

I have tried adding .Result .Text and .Value with no luck.

 

Any help would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
KvB1
Solution Sage
Solution Sage

The cleanest way to fix this is to use a combobox instead of a dropdown, as the type of ComboBox.SelectedItems is also a table. The controls are very similar, and allows you to selected multiple technicians.

Otherwise you would probably need to store the value of the dropdown in a temporary collection, and use that to populate the column in your patch function.

View solution in original post

3 REPLIES 3
KvB1
Solution Sage
Solution Sage

The cleanest way to fix this is to use a combobox instead of a dropdown, as the type of ComboBox.SelectedItems is also a table. The controls are very similar, and allows you to selected multiple technicians.

Otherwise you would probably need to store the value of the dropdown in a temporary collection, and use that to populate the column in your patch function.

WarrenBelz
Super User
Super User

Hi @CrashData ,

Try this

ForAll(
   Filter(
      AssignTechTable.AllItems,
      Tech1toggle.Value = true
   ),
   Patch(
      CIG_DataBases,
      ThisRecord,
      {
         'Technician 1 appointed ': {Value:Tech1Dropdown.Selected.Value},
         'Technician appointed date': Now()
      }
   )
)

 

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.

CrashData
Frequent Visitor

Thanks so much @KvB1, works like a dream!!!! Changed the input to a combo box pointing to the same choices updated the patch to the ComboBox.SelectedItems you suggested. 

 

Limited the combo box to one selection as well.

 

Thanks so much, really appreciate the help

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,409)