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 Apps
Answered

Collect in a map

(1) ShareShare
ReportReport
Posted on by 18

I try to create a collection that select in a map the selection in ComboBox1 and 2 rows in tabla1, but my code didn't run

 

Need Help 🙂

 

Navigate(MapScreen1; ScreenTransition.Fade) &&
ClearCollect(
colLocations;
ComboBox1.SelectedItems &&
First(Tabla1);
LookUp(Tabla1; RowNumber(Tabla1) = 31);
LookUp(Tabla1; RowNumber(Tabla1) = 32)
)

Categories:
I have the same question (0)
  • developermct Profile Picture
    37 on at

    It looks like you're trying to use Power Apps to create a collection based on selections from ComboBox1 and specific rows from Tabla1. The ClearCollect function is a good choice for this, but the syntax you're using seems to be incorrect. The && operator is not used for combining collections in this context.

     

    Here's a revised version of your code that should work:

    Navigate(MapScreen1, ScreenTransition.Fade);

    ClearCollect(
    colLocations,
    ComboBox1.SelectedItems,
    First(Tabla1),
    LookUp(Tabla1, RowNumber(Tabla1) = 31),
    LookUp(Tabla1, RowNumber(Tabla1) = 32)
    );

    In this version, I separated the Navigate and ClearCollect functions with a semicolon, which allows you to execute multiple functions in sequence. Inside ClearCollect, I used commas to separate the different items you want to collect.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Rober1,

    I think you have to provide more details about your need.

    The way you generate the collection is wrong at some degree, ComboBox1.SelectedItems returns a column named Value, however, First(Tabla1) returns a single record including all the columns from Tabla1, so do the left 2 records returned by the LookUp() function.

     

    Finally, you will get a collection as below:

    vqiaqimsft_0-1696907970190.png

    Not sure if it is what you want, however, if it is, you need to modify your formula as below:

    Navigate(MapScreen1; ScreenTransition.Fade);;
    ClearCollect(
    colLocations;
    ComboBox1.SelectedItems ;
    First(Tabla1);
    LookUp(Tabla1; RowNumber(Tabla1) = 31);
    LookUp(Tabla1; RowNumber(Tabla1) = 32)
    )
  • Rober1 Profile Picture
    18 on at

    When I click on the button, it takes me to the Map Screen1 page, where I have a map with the points selected by comboBox1. What I need is to always have two fixed points displayed from table1, which are the starting point and the ending point of the route (and they are always the same and fixed).

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @Rober1,

    "What I need is to always have two fixed points displayed from table1, which are the starting point and the ending point of the route (and they are always the same and fixed)."

     

    I don't get it, and I could not imgine the data set on your side, you should provide more details to let me know how you want to save the data in the collection.

  • Rober1 Profile Picture
    18 on at

    Rober1_0-1696923831676.png This is Tabla1

    When I click on the button, it takes me to the Map Screen1 page, where I have a map with the points selected by comboBox1. What I need is to always have two fixed points displayed from table1, which are the starting point and the ending point of the route (and they are always the same and fixed).

     

    I try this, and i think that this code is correct

     

    Navigate(
    MapScreen1;
    ScreenTransition.Fade);;
    ClearCollect(
    colLocations;
    ComboBox1.SelectedItems;
    First(Tabla1);
    LookUp(
    Tabla1;
    'Denominación OT' = "Inicio Ruta"
    );
    LookUp(
    Tabla1;
    'Denominación OT' = "Final Ruta"
    )
    )

     

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @Rober1,

    Well, this formula is the modified one I gave you before.....

    You replace the parameter in the LookUp() function apply to your need, which is greate.

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!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard