Flow - Item not in Dynamic content but returned in JSON?
I’ve been doing some work with Flow recently, specifically around approvals which I’ve written about here. I’m creating an approval system for quotes and wanted to send some information to users via Flow so that they could make an informed decision inside their emails. However when I tried to send certain fields, they were returning blank.
I was a little confused and started troubleshooting. The system in question had a few older fields from a previous migration and I was actually using the wrong field. My bad. So I started looking for my field and I couldn’t find it. What?
I was using a CDS trigger and thought maybe it was not returning all the information so created a Get Record action to ensure I was getting all the data from the entity. I went to add the field again and it still wasn’t there. I took to twitter to vent my frustrations and the D365 Community came back with a solution. It’s one of the reasons I love this community.
Problem - Revision Number on Quote is not being return in Flow
First up, Jason Almeida with the cause of the problem.
OK, so it’s another “special” field that Dynamics has, I can understand that. But i’m not trying to do anything unusual with it, just want to present the data to someone.
Cause - The revision number field is not valid for create or update.
Copying the revision number to another field will return it fine but it’s not a great solution.
Matt Beard chimes in.
I looked at the test and in the body of the trigger, I can see revision number is being returned, that’s why this was so confusing.
However, Matt then gave me the solution.
Eureka! That’s it.
Solution - Put the field returning in the JSON object as an expression.
So here’s the strange part, even though I tried over and over to find revision number, if you cut and paste the expression anywhere else, it resolves as a dynamics content field with the correct name. Flow definitely understands and recognises this field and it works when you use it in emails etc, but it’s not Dynamic Content you can’t select? Very strange.
But it’s a simple workaround, if you ever struggle to find a field you require, but you see it come back in the JSON response/Body in your test Flow, you can put it in a expression and then it can be used.
Ciao for now!