web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Ectracting values, "us...
Power Automate
Answered

Ectracting values, "userDefinedFields"

(1) ShareShare
ReportReport
Posted on by 14

Hi,

 

I have built a flow where I managed to extract values from "userDefinedFields" so that I can send email to emailadresses coming from "Epostadresse mottaker av egenkontroll" (a user defined field). I want to send different emails to the different adresses, and I want to build the body of the email using some of the other user defined fields.


So I have tested it, and it worked - until I changed a value (text basically)  in the system where the data comes from.

So I am using indexing (hardcoded index...or something?) to get the values using a expression like: items('Apply_to_each')?['data']['userDefinedFields']?[2]?['value']

 

This expression did extract the email adress, because "Epostadresse mottaker av egenkontroll" was the third user defined field in the data. But when I changed some text in one of the fields, the result attached showed that the user defined field "Epostadresse mottaker av egenkontroll" now was number two.


So the order of the fields are not set or consistent. 

 

Is there a way to extract these values based on the name of the user defined field, and not using  [0] og [1] or [2]?

 

WilliVev_0-1697925301949.pngWilliVev_1-1697925314491.png

 

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @WilliVev 

     

    Map that Userdefinedfields in a compose then use a filter array to extract the desired value. Here is an example.

     

    image.png

     

    Above use expression item()['name']

     

    image.png

     

    Above expression is as follows:

     

    outputs('Filter_array')?['body']?[0]?['value']
     
    Thanks
  • WilliVev Profile Picture
    14 on at

    Hi @abm ,

     

    Thank you! I first created three different loops, but I soon discovered that I could not acess all user defined fields outside the loop to send a emai. So i did what you suggested x 3, for the three fields, inside one loop. Works perfectly together with the send email action now.

     

    Thanks again!

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @WilliVev 

     

    Yes in your case body is an array so it must be inside a loop. Glad to hear that all sorted and thanks for accepting the solution.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,005

#2
Valantis Profile Picture

Valantis 825

#3
Haque Profile Picture

Haque 619

Last 30 days Overall leaderboard