I'm creating a approval workflow when an item is created or modified in canvas app using Sharepoint as data source,
there are two person type field , one is the main approver and other field is delegate to (not compulsory field, this is filled when the main approver field is empty), so when ever user fills all required fields and submit the form (many times delegate person type field remains empty/blank)
I'm using http get request action in order to get the approver ID with formula as _api/web/SiteUsers/getByEmail('abc@xyz.com')
and assigning it to a variable , this variable is using to assign access/right over that record using http post request : _api/lists/getByID('3452435234')/items()/roleassignments/addroleassignment(principalid=variable,roledefid=1073741827).
So my flow breaks whenever delegate person type field is blank /empty.
What can be the solution to this approval flow , any help will be highly appreciated .