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

Lookup table in AddColumns

(0) ShareShare
ReportReport
Posted on by 2,297

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,299 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,297 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,299 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,297 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

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard