To update the fields only based on what you have entered in forms, you need to use conditional branching where you have to check whether fields value entered in MS form is empty or empty , if not empty- use update item to update that field accordingly. But problem is it becomes too complex as number of conditions action to be used depends upon numbers of fields need to be updated in Sharepoint.
So another easy would be use single update item action and update all fields at once with its original value present for that item even if the form field value is empty- this makes the code less complex.
To get an idea of this- refer the flow as shown below
Assume i have below SP list where i need to update JOb and amount field based on UID which is unique identifier for each record.
So the flow design to update the fields would be like below, here user enters the UID need to be updated and other fields need to be updated associated with that.
i have designed a sample form like below
Now the flow would be like below
1. Use form's trigger and associated actions to get the response details as shown below
2. Now use get items to get the details of item for given UID entered in form
Here i am using ODATA filter query to filter details of given item having UID entered in form.
3. use update item to update the item details based on details entered in form as shown below
The above expression for ID field is for finding the ID of list item where uid equals as entered in form.
first(outputs('Get_items')?['body/value'])?['ID']
Now coming to update fields - Job and Amount , see the expression used below
for Job field, this expression has been used
if(empty(outputs('Get_response_details')?['body/r5865bfa48e3944a5b6dcd24bf8a03aec']),first(outputs('Get_items')?['body/value'])?['Job'],outputs('Get_response_details')?['body/r5865bfa48e3944a5b6dcd24bf8a03aec'])
Here the above expression checks whether MS form field for Job has empty value- if yes flow updates the field with value already present in list item, else it will take the value present in form field.
The same kind of expression will be used for in amount field as well.
So this logic is for updation part. In your case, you need two fields to lookup the item details- so update the Odata query accordingly using logical operators- refer for more details
Hope this helps !