Patch value of dropdown back to sharepoint list

456 Views Asked by At

I populated a dropdown list with values from a column in a collection. I am now trying to patch the selected value back to my sharepoint list and I'm getting errors.

The formula in the Items property of my dropdown is colBudgetFilter.LineItem

The Patch formula I'm trying to use is...

Patch(
    Vouchers,
    LookUp(Vouchers, ID=gal_FirstApprover_VoucherDetails.Selected.ID),
    {
        LineItem: lbl_FirstApprover_LineItemDetail.Selected.Value
    }
);

The error I'm getting is The type of this argument 'LineItem' does not match the expected type 'Text'. Found type 'Error'.

I've worked with dropdowns before and they have worked just fine like this, but I've never tried to do the same using a collection as the dropdown data source.

What could be wrong?

2

There are 2 best solutions below

0
Ada Eloka On BEST ANSWER

In the items property use Distinct(colBudgetFilter,LineItem) instead of colBudgetFilter.LineItem

0
mmikesy90 On

My guess is that your formula should reference the field in the collection as LineItem instead of Value

Patch(
        Vouchers,
        LookUp(Vouchers, ID=gal_FirstApprover_VoucherDetails.Selected.ID),
        {
            LineItem: lbl_FirstApprover_LineItemDetail.Selected.LineItem
        }
    );