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

Notifications

Announcements

Community site session details

Community site session details

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

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,865 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,865 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard