cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dorinda
Impactful Individual
Impactful Individual

Click on Map InfoCard and add to gallery list (Updated really need help)

I know that you can do this in reverse where you click on the gallery item and it will display on the map.  I however need to be able to display all of the pins on the map and then be able to click on that specific pin and have it added to another gallery that is being used to create a new record.

 

Is this possible?

12 REPLIES 12
Dorinda
Impactful Individual
Impactful Individual

Ok so I sorta have made progress, but not really,  I am able to click on the map pin to create a item in a collection.  However, with this I have several issues.

1.  When I click on the map pin it is not just adding 1 item it is adding 8, I have no idea why.  Here is that code.

Collect(GallerySelectedCollection,Map1_1.Selected,Remove(GallerySelectedCollection,Map1_1.Selected),Collect(GallerySelectedCollection,Map1_1.Selected));
ForAll(GallerySelectedCollection,
    Collect(tempCollection,
        Last(FirstN(
            AddColumns(
                DropColumns(GallerySelectedCollection, "row"),
            "row",CountRows(tempCollection)+1
            ),
        CountRows(tempCollection)+1)
        )
    )
);
ClearCollect(GallerySelectedCollection, tempCollection);
Clear(tempCollection)

Here is a screen shot of the collection showing the data being collected

Dorinda_0-1650468506171.png

As you can see it has data displaying in the collection, which leads to the second issue.

 

2.  When I attach the collection to the gallery NOTHING IS SHOWING, as shown above we are getting data.  Here is the code on the gallery

 

GallerySelectedCollection

 

And here is a screen shot of the gallery that should be displaying information.

Dorinda_2-1650468675133.png

I have made sure that all visibility is good, i have made sure it is in front, i have made sure that the fields exist correctly from the collection, I have made sure the font color is black.

 

I cannot figure out why data that is showing in the collection is not bubbling up in the gallery.

 

A bit of back story here as well, the main list lives in the Dataverse and has approx. 62K records, however we are only loading 100 at a time or filtering based either on a dropdown or a text input box.  This is standard out of the box functionality with PowerApps.

 

I am stumped any guidance would really be appreciated.

Dorinda
Impactful Individual
Impactful Individual

@RandyHayes Do you have any suggestions on how to fix this.  Since no one else is offering any help?

Dorinda
Impactful Individual
Impactful Individual

Wow I can't believe no one can even offer an idea up I could really use some help with this.

Dorinda
Impactful Individual
Impactful Individual

@Drrickryp  are you able to help me get this resolved?  No one else is helping 

 

Drrickryp
Super User
Super User

@Dorinda 

I'm sorry but I have no experience dealing with maps in PowerApps.

apdunnamMS
Microsoft
Microsoft

  1. Hi @Dorinda ,

    Are you using the out of the box Map Component in Power Apps that's available through the "Media" tab?  If so, it should be relatively straightforward to populate a collection of selected pins. 

The process is below:

  1. Select your map component
  2. Select "OnShapeSelected" from the Properties dropdown for the map
  3. Paste this in the formula bar: Collect(colSelectedLocations,Map1.Selected)
  4. Tie your gallery to that collection

MapCollect.png

 

Dorinda
Impactful Individual
Impactful Individual

@apdunnamMS Thanks for your answers.  This is what I have sorta working

 

If( Map1_1.Selected.FID_1 in 'Pole Attachments'.crb09_fid_1, Remove(GallerySelectedCollection,Map1_1.Selected),Collect(GallerySelectedCollection,Map1_1.Selected));
Clear(tempCollection);
ForAll(
    GallerySelectedCollection,
    Collect(
        tempCollection,
        {
            Latitude: Latitude1_1,
            Longitude: Longitude1,
            SN: SN,
            FID: FID_1
        }
    );
    
    Last(
        FirstN(
            AddColumns(
                GallerySelectedCollection,
                "RowNumber",
                CountRows(tempCollection) + 1
            ),
            CountRows(tempCollection) + 1
        )
    )

)

 

The issue is when I click on the onselect in the map it is adding it to the collection but when I put the collection in a gallery nothing is showing, but there is content in the collection, and it is not doing the row number either

apdunnamMS
Microsoft
Microsoft

@Dorinda 
I would need more information from you to help troubleshoot:

1. Where do you have this formula running? - On which property is it associated with?

2. What control are you using for the map functionality?

3. What is in the Items property of your gallery?

4. What is your data source for the map data?
5. What is the purpose of the If statement and remove function?

Generally, I recommend starting with a simple use case and gradually adding complexity. So if your end goal is to click on a pin in the map and have it output to a gallery, forget the conditional logic at first and just do the simple method I outlined.  Does that process work?  If so, try adding in the additional logic one piece at a time.

Dorinda
Impactful Individual
Impactful Individual

@apdunnamMS 

 

Please see below

 

1. Where do you have this formula running? - On which property is it associated with? OnSelect

2. What control are you using for the map functionality? Out of the box Map Control

3. What is in the Items property of your gallery? GallerySelectedCollection

4. What is your data source for the map data? SharePoint list
5. What is the purpose of the If statement and remove function? if they selected the wrong pole to be able to remove it from gallery it is also used if i can get the row numbering to work.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,713)