I have a sharepoint list called "Varer" with a column "Varenavn" set to single line of text.
Then I have another sharepoint list called "Bestillinger" with a column "Vare" set to single line of text. In my list "Bestillinger" i want to add new items to the list with choices coming from the "Varer" list and the "Varenavn" column. Also i want to write a status field value when the form is submitted. In powerapps I have customized the new item form for the "Bestillinger" list. I have added a custom dropdown control and set its Elements to "Varer" and Value to "Varenavn". This works. When running the form it shows the items from the "Varer" list in the dropdown. But I cannot figure out how to make the selected value from the dropdown get saved to the list "Bestillinger" when the form is submitted. I tried to use the Patch function on the "OnSave" event. But cant find the right syntax:
If(
SharePointForm1.Mode = New,
Patch(
Bestillinger,
{ID: Blank()},
SharePointForm1.Updates,
{ Status: "1 - Forespørgsel"()}
Vare: {
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
Value:VareDropdown1.Selected.Value
}
)
),
SubmitForm(SharePointForm1)
)