AZURE ADF Expressions- Using Deeply nested map in ADF dataflow expressions using both Find and map in the same expression

2023-06-14T05:07:03.58+00:00

As part of our implementation we are using map and find function the same expression as shown below

map(array1, @(name = #item_1.Name, Age = #item_1.Age, Title = iifNull(find(titles, #item_2.OldTitle = #item_1.Title).NewTitle),'MR'))

Getting the below error "No field Name title in the hierarchical structure".

Kindly let me know how to use the map and find function within the same expression

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2023-06-15T09:19:09.2533333+00:00

    Hi Dharuman, Nandha kumar (Cognizant),

    Thank you for posting query in Microsoft Q&A Platform.

    From the error message, it seems in the item of your array array1. There is no field Name or Title. So kindly make sure you are hierarchy objects has the fields correctly and same fields are getting used here.

    Below is an sample example of how you can use map and find functions within the same expression:

    map(array1, @(name = #item_1.Name, Age = #item_1.Age, Title = iifNull(find(titles, #item_2.OldTitle == #item_1.Title).NewTitle, 'MR')))
    

    In this example, array1 is an array of objects, and each object has Name, Age, and Title fields. The find function is used to find the corresponding NewTitle value in the titles array based on the OldTitle value in the array1 object. If the NewTitle value is not found, the default value 'MR' is used.

    Hope this helps. Kindly try same as above example by using correct fields in expression. Please let me know how it goes and if still not helps, then share more details of input schema and expected output from transformation and other details. So that we can help more better.


    Please consider hitting Accept Answer button. Accepted answers help community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.