RE: Getting Customer dynamically to Create Case record from SharePoint
Hi Babu,
The logic should be like this.
The Customer of Case is Account or Contact, so we need to search for both Account and Contact.
Search for Contact first. If the number of Contacts search results is greater than 0, then get the GUID of a Contact. If the number of search results is 0, then search for Account.
If the number of Accounts search results is greater than 0, then get the GUID of an Account. If the number of search results is 0, it means that the customer does not exist in D365, so we send an email to remind the D365 user.
This is a full view of Flow.

These are screenshots of detailed steps.
The first condition is length(body('List_contacts')?['value']).
The second condition is length(body('List_accounts')?['value']).

Among them, in List contacts and List accounts, in order to avoid listing multiple records, the Top Count is 1, so in both conditions, we only need to compare whether the length (count) is 1.