I have a data flow where the density value is getting picked from Density (dataverse table). The density value is dependent on the combination of 5 fileds. So I have used list rows function and in fliter I have the formula as-
cra54_cluster eq '@{items('Apply_to_each')?['Cluster']}'
and cra54_name eq '@{items('Apply_to_each')?['Waste Stream']}'
and cra54_wastetype eq '@{items('Apply_to_each')?['Waste Type']}'
and cra54_pricetype eq '@{items('Apply_to_each')?['Pricing Type']}'
and cra54_bintype eq '@{items('Apply_to_each')?['Bin/ Equipment Type']}'
Then I have the apply to each action with "value" (from the list rows). I have set a variable with the formula-
items('Apply_to_each)['densityvalue']
1) Scenario 1- where the density value is existing in the table it picks the right value.
2) Scenario 2- When for the combination of fields , no density value exist in table, that scenario is not executed. I want that 0 or blank should be returned for these cases.
After digging in a bit dipper, I saw that the value looks like this for both the scenarios-
Scenario 1-
"value":[{"@odata.type":"#Microsoft.Dynamics.CRM.cra54_densityconversion","@odata.id":"https://org62826572.crm6.dynamics.com/api/data/v9.1/cra54_densityconversions(0206c90b-981f-ee11-9966-002248e352b4)","@odata.etag":"W/\"2603837\"","@odata.editLink":"cra54_densityconversions(0206c90b-981f-ee11-9966-002248e352b4)","cra54_densityconversiontonnem3":"0.07","cra54_densityconversionid@odata.type":"#Guid","cra54_densityconversionid":"0206c90b-981f-ee11-9966-002248e352b4"}]}}Scenario 2-
"value":[]}}
I am not sure how to handle the situation, in scenario 1 I want the value as 0.07 ("cra54_densityconversiontonnem3":"0.07") and in scenario 2 blank or 0.
Need help from experts here.
Thanks