Hi,
I have been looking around a bit for my question but haven't had any luck so far.
In my head, this should be pretty straightforward but is giving me trouble...
So I have a Flow where I need to set a variable depending on whether the Customer field is a type of Account or Contact.
I can't get my condition to work properly - it's returning false every run. And I'm 100% sure that the case has an "Account" in the Customer field.
I have tried the following conditions:
Customer (Value) | is equal to | Account |
Customer (Value) | is equal to | account |
Customer (Value) | is equal to | accounts |
Customer (Type) | is equal to | Account |
Customer (Type) | is equal to | account |
Customer (Type) | is equal to | accounts |
Here is a screenshot of my flow.
Can someone please explain to me what I'm doing wrong?
Thanks!
Solved! Go to Solution.
That explains a lot! 😁
What happens if you put this expression in the compose action:
triggerOutputs()?['body/_customerid_type']
That may not be right, a partial guess as you didn't post your complete output of the trigger action. But might work.
Go into your run history, check the output of the trigger step "When a record is created, updated or deleted". From that you will be able to find the exact property and value that you need to be matching. If you find that bit and post the result here it will be easy to make your condition.
Hi,
Thanks for reply.
Here is the case body output:
and here is how I would set the condition:
based on your screenshot you would expect "accounts" to be an equal match. Try creating a compose step before the condition which just outputs "Customer (Type)" from the dynamic content an call it "customerType". Then you will be able to use that value on the left side of the condition, and also see what it was set to before the condition takes place. The other thing you might try on the right side of the condition is an expression of:
string('accounts')
and see if that produces a different result.
Thanks for the quick reply.
I have done the following without any luck:
But I'm not too familiar with the "compose" action so I might be misunderstanding something.. 🙂
You did it correctly, when you look in the run history, what is output of the compose? Did you also try what I mentioned about and put the expression:
string('accounts')
On the right side of the condition?
This is my compose output:
And when I Click to download it opens up a new "about:blank" webpage. All blank. Really weird..
And yes, I also tried with the string('accounts')
That explains a lot! 😁
What happens if you put this expression in the compose action:
triggerOutputs()?['body/_customerid_type']
That may not be right, a partial guess as you didn't post your complete output of the trigger action. But might work.
Thank you very much @Paulie78 !
That expression did the trick!
Would I be able to use that expression directly in the condition? Or do I need the compose step action?
You do not need the compose step, that was just for troubleshooting/visibility purposes, feel free to delete it and put the expression in the condition.
Find the way to get the customer record for an entity.
Example: I want to get the contact - customer lookup this can be account or contact else blank.
Step 1 : Get the contact record by contact id and select "_parentcustomerid_value" to return at least, can be ignored that will give full list of fields
Step 2 : Run the flow take the output of the flow action from above step and copy body on to Parse Json.
content use out put from get contact details - body & generate sample.
Step 3: Important step to identify customer lookup logical name - Compose date oprator user - body('Parse_JSON')?['_parentcustomerid_value@Microsoft.Dynamics.CRM.lookuplogicalname that returns lookup logical name in case if you want get the out put as null use coalesce it returns value if blank coalesce(body('Parse_JSON')?['_parentcustomerid_value@Microsoft.Dynamics.CRM.lookuplogicalname'],'none')
Step 4: Use switch statement and use output of the compose to branch the contact or account else default to get the record values
Step 5: Get contact or account details
If you find useful please thumbs up.
User | Count |
---|---|
98 | |
39 | |
27 | |
23 | |
16 |
User | Count |
---|---|
130 | |
52 | |
48 | |
36 | |
24 |