I was trying to use Power Automate to generate automated emails when a Survey was submitted that was missing data when certain conditions were met. One issue I had was getting the project name into the email. The project name field is a coded value domain and it would only give the code and not the value in the email, which isn't very useful to most people.
I hadn't seen any solutions for dynamically pulling values from a coded value domain using Power Automate that didn't involve creating a new field in the feature layer and populating that field with the value and then calling the field in Power Automate. My issue was the CVD values are buried a couple levels deep in a JSON and I had a real hard time figuring out how to access them. The get coded value domains from feature layer can output a specific cvd list, but Power Automate did want to recognize it as a valid json format in later steps.
Here's my workflow. This uses the premium level ArcGIS connection. I used the When a Survey Response is Submitted as the trigger and the "Get Coded Value Domains from Feature Layer as an action. I then added the Initialize Variable action with the type set to String and value dynamic content pointing to the Project Name field from When a Survey Response is Submitted. I gave the variable a name of Project Value, which is what you will look for in Dynamic Content later on.
At this point save and run a test. In the test results go to the Get Coded Value Domains from Feature Layer, click Show Raw Outputs, and then copy and paste the raw output into a parse json viewer. I used this one https://jsonviewer.stack.hu/ You can view it as text or use the Viewer tab to see the schema of the json in an expandable structure view to understand how everything is nested. In my instance I am looking for the "projname" domain and the "codes" under that. Codes puts the cvd code first and then the value it is formatted like "test1234": "Test Project". Names flips that and puts the value first and then the cvd code so you would get "Test Project": "test1234". It is important to use the Codes because the name:value pairing of the json
My next action to add is Parse JSON. For the content I will use the Body dynamic content from Get Coded Value Domains from Feature Layer and then to get down to the specific cvd I want I need to add a little bit extra to it. To drill down a level in the json you need to add the name of the level in square brackets and apostrophes to the end of the dynamic content. You add another one for the next level. So to get to the codes of my projname cvd the content of the Parse JSON action looks like this: