cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
J_Taylor
Advocate II
Advocate II

Patch of form (from SP choice column) with error "expected type Record. Found type Table."

I have a SharePoint list ("123456_DOE, John) that I am trying to patch to. The data for the patch is coming from a form (the form is created by a different SP list 'Template' with the same headers). The form contains the fields number, single line of text, choice and attachment. So far, I keep getting an error on the choice fields.

 

The line for the choice fields are saying, "The type of this argument 'Frequency_of_Support' does not match the expected type 'Record'. Found type 'Table'."

 

To help diagnose the problem, I created a button that collects the output of one of the choice fields. The output of the collection - which is the 'Table' of the field is:

J_Taylor_2-1665108949270.png

I'm not sure how I get only the value column from the table. I am confused, because the value column would look the exact same as the table.

 

I tried doing ***.SelectedItems.Value, but this is either invalid (it is not suggested as an option from the autocomplete/intellisense) and/or produces the same result (output is a table).

 

Any help on how to get the type Record (instead of Table) would be grealty appreaciated.

 

The whole code:

J_Taylor_1-1665108733118.png

Patch(
    '123456_DOE, John',
    Defaults('123456_DOE, John'),
    {
        Student_Number: Value(Student_Number_DataCardValue.Text),
        First_Name: First_Name_DataCardValue.Text,
        Last_Name:Last_Name_DataCardValue.Text,
        'Key Learning Area': 'Key Learning Area_DataCardValue'.Text,
        Date_Upload: Date_Upload_DataCardValue.SelectedDate,
        Inclusive_Education_Department: Inclusive_Education_Department_DataCardValue.Value,
        Classroom_Accommodations: Classroom_Accommodations_DataCardValue.SelectedItems,
        Curriculum_Adjustments: Curriculum_Adjustments_DataCardValue.SelectedItems,
        Alternative_Assessment_Procedures: Alternative_Assessment_Procedures_DataCardValue.SelectedItems,
        Adjustments_Instructions_Students: Adjustments_Instructions_DataCardValue.SelectedItems,
        Instructional_Adjustments: Instructional_Adjustments_DataCardValue.SelectedItems,
        Social_Behaviour_Adjustments: Social_Behaviour_Adjustments_DataCardValue.SelectedItems,
        Support_Services_Adjustments: Support_Services_Adjustments_DataCardValue.SelectedItems,
        Support_Individual_Needs_of_Student: Support_Individual_Needs_of_Student_DataCardValue.SelectedItems,
        Evidence_of_Teacher_Documented_Adjustments: Evidence_of_Teacher_Documented_Adjustments_DataCardValue.SelectedItems,
        Evidence_of_Consultation_Collaboration: Evidence_of_Consultation_Collaboration_DataCardValue.SelectedItems,
        Intensity_of_Support: Intensity_of_Support_DataCardValue.SelectedItems,
        Frequency_of_Support: Frequency_of_Support_DataCardValue.SelectedItems,
        Description: Description_DataCardValue.Text,
        Attachment: Attachment_DataCardValue.Text,
        Attachments: Attachments_DataCardValue.Attachments
    }
    );

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @J_Taylor ,

 

Please use  ***.Selected instead of  ***.SelectedItems.Value

 

Best Regards,

Wearsky

View solution in original post

v-xiaochen-msft
Community Support
Community Support

Hi @J_Taylor ,

 

'"The type of this argument 'Frequency_of_Support' does not match the expected type 'Record'. Found type 'Table''

If the choice column is a single choice column, it will expect type 'Record' i.e. {Value:"value1"}

If the choice column is a column allows multiple selections, it will expect type 'Table' i.e. Table({Value:"value1"},{Value:"value2"}).

So, my guess is that your column is a single choice column. Please check it.

Besides, please refresh your datasource in canvas app.

 

Best Regards,

Wearsky

View solution in original post

3 REPLIES 3
v-xiaochen-msft
Community Support
Community Support

Hi @J_Taylor ,

 

Please use  ***.Selected instead of  ***.SelectedItems.Value

 

Best Regards,

Wearsky

No, I want to patch all selected items from the choice field.

v-xiaochen-msft
Community Support
Community Support

Hi @J_Taylor ,

 

'"The type of this argument 'Frequency_of_Support' does not match the expected type 'Record'. Found type 'Table''

If the choice column is a single choice column, it will expect type 'Record' i.e. {Value:"value1"}

If the choice column is a column allows multiple selections, it will expect type 'Table' i.e. Table({Value:"value1"},{Value:"value2"}).

So, my guess is that your column is a single choice column. Please check it.

Besides, please refresh your datasource in canvas app.

 

Best Regards,

Wearsky

Helpful resources

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