This should have been a new question, but you could have looked at what Stalin Ponnusamy & I posted for an example of how to use Patch. If you aren't using multiple forms, though, I don't know why you wouldn't just use SubmitForm(formNameHere). Maybe you just want to submit just those fields, I guess. But, in any case, when you have a lookup field, you must manually find the ID and value for that field. You cannot just do PMInterval: Combo_PMInterval.Selected.Value, for example, if PMInterval comes from a SharePoint list. A choice field presents a similar problem. So you would have to do something like:
Patch(
'PMInspections',
{ID: Value(lblID.Text)},
Defaults(PMInspections),
{
Title: TextInput_Action.Text,
Status:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:1,
Value:Combo_Status.Selected.Value
},
Comments: TextInput_Comments.Text,
PMInterval: {
Id: LookUp('My PMInterval List', 'MyLookupFieldName'=Combo_PMInterval.Selected.Value).ID,
Value: Combo_PMInterval.Selected.Value
}
}
)
This assumes that "Status" is just a Choice field and you want the 2nd option, since ID of 0 is the 1st option, and that "PMInterval" is a lookup field to a list.
You didn't provide enough details to know what you were doing and where your data was coming from. It's also where you might not need to call out those specific fields if they were all just within a single form. You could just have them like that, and then do:
Patch(
'PMInspections',
{ID: Value(lblID.Text)},
Defaults(PMInspections),
Form1.Updates,
{
PMInterval: {
Id: LookUp('My PMInterval List', 'MyLookupFieldName'=Combo_PMInterval.Selected.Value).ID,
Value: Combo_PMInterval.Selected.Value
}
}
)
You will always have to do the lookup field afterwards, regardless, because SharePoint doesn't like updating those automatically since it doesn't know the ID to use.
And speaking of IDs, you'll note that I'm using lblID.Text. I have the ID being populated into a hidden label because I don't need it nor want it displayed on the form. So this is a way to ensure it can update. Without the ID field, it cannot, unless you use a similar trick. For example, I probably could have added the ID field and then hid it, and then just replace my lblID with whatever I named the DataCard's textbox (txtID, or whatever...).