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 Apps / Lookup table in AddCol...
Power Apps
Unanswered

Lookup table in AddColumns

(0) ShareShare
ReportReport
Posted on by 2,295

This is my "Tab" collection:

 

WebPortal_0-1607612931206.png

 

 

It was built with a ClearCollect (... AddColumns(....)) expression.

 

Now, I want to Lookup the "ID_Evento" column in another table. Is this possible to do within the same expression within the AddColumns, or do I have to create another expression?

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @WebPortal 

    Sure, in your AddColumn formula, just do the Lookup there.

     

    AddColumns(
     your existing formmula,
     "yourLookup", LookUp(otherTable, criteria)
    )

    I hope this is helpful for you.

  • WebPortal Profile Picture
    2,295 on at

    @RandyHayes 

     

    This is the entire formula:

    ClearCollect(
    Tabs,
    AddColumns(
    GroupBy(
    Eventos,
    "ID_Evento",
    "Tab"
    ),
    "DataIni",
    Text(
    Min(
    Tab,
    'Data de Início'
    ),
    "[$-en-US]dd/mm/yyyy"
    ),
    "IDCurso",
    Max(
    Tab,
    ID_Curso
    ),
    "IDFormador",
    Max(
    Tab,
    ID_Formador
    ),
    "Valor",
    Sum(
    Tab,
    Valor
    ),
    "Local",
    First(
    Sort(
    Tab,
    'Local de realização',
    Ascending
    )
    ).'Local de realização',
    "Tipologia",
    First(
    Sort(
    Tab,
    Tipologia,
    Ascending
    )
    ).Tipologia,
    "Modalidade",
    First(
    Sort(
    Tab,
    Modalidade,
    Ascending
    )
    ).Modalidade,
    "Estado",
    First(
    Sort(
    Tab,
    'Estado',
    Ascending
    )
    ).'Estado',
    "TituloCurso",LookUp(Cursos, ID_Curso = IDCurso).Designação
    )
    )

     

    The last part in the LookUp I'm getting an error:

    WebPortal_0-1607613650875.png

     

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @WebPortal 

    Yes, that name does not exist in the scope of your AddColumns.  If you were to do another AddColumns outside of the AddColumns, then it would exist.

    But the simpler answer is the following:

    ClearCollect(
     Tabs,
     AddColumns(
     GroupBy(Eventos,
     "ID_Evento",
     "Tab"
     ),
     "DataIni", Text(Min(Tab,'Data de Início'), "[$-en-US]dd/mm/yyyy"), // NOTE: Min is not reliable on Dates
     "IDCurso", Max(Tab, ID_Curso), 
     "IDFormador", Max(Tab, ID_Formador),
     "Valor", Sum(Tab, Valor),
     "Local", First(Sort(Tab,'Local de realização',Ascending)).'Local de realização',
     "Tipologia", First(Sort(Tab,Tipologia,Ascending)).Tipologia,
     "Modalidade", First(Sort(Tab,Modalidade,Ascending)).Modalidade,
     "Estado", First(Sort(Tab,'Estado',Ascending)).'Estado',
     "TituloCurso", LookUp(Cursos, ID_Curso = Max(Tab, ID_Curso)).Designação
     )
    )
  • WebPortal Profile Picture
    2,295 on at

    @RandyHayes 

    Ok, that makes sense, thanks for helping!

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard