cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jlongo
Frequent Visitor

Add collums to a filtered dataverse table collection

Hi all

 

I'm trying to use map component with data that is on dataverse table.

My first problem was to use filtered data, but i have fixed that passing the filtered data to a collection using clearcollect. One thing strange to me is to use the data collection i need to explicity refer them on the filter otherwise i have the fields but it seems to be empty. Also, on map component i have to use field "instances names" (something like "cr0ef_field_name") for using them on some properties (newbie troubles i know but i hope to get there...). Now my actual problem... i need to add two collumns that are calculated based on some fields from filter: one column to used on color and other on icons map properties. I tried but without avail...

The code i have now working on collection is :

ClearCollect(ListaField; Filter(
    FieldMap;
    (DateValue(Text(a10_intervencao)) >= dtpData.SelectedDate && DateValue(Text(a10_intervencao)) <= dtpData2.SelectedDate) || 
    (DateValue(Text(a02_criado)) >= dtpData.SelectedDate && DateValue(Text(a02_criado)) <= dtpData2.SelectedDate);
    IsBlank(cbEquipas.SelectedItems.Value) ||IsEmpty(cbEquipas.SelectedItems) || a05_equipa in cbEquipas.SelectedItems;
    IsBlank(cbTipos.SelectedItems.Value) ||IsEmpty(cbTipos.SelectedItems) || Left(a18_tipo; 1) = Left(cbTipos.Selected.Value;1); !IsEmpty(a16_latitude);!IsEmpty(a17_longitude);!IsEmpty(a12_tecnico);!IsEmpty(a18_tipo);!IsEmpty(a04_nome)
))

I need to add a collum "Cor" wich is based if  "a12_tecnico" is empty and one "icon" based on "a18_tipo".

I have tried with addcollums after clearcollect filter, clearcollect with addcollumns with filter and other without any luck...

 

Can someone point me the right path ?

 

TIA

 

JL

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @jlongo :

Maybe you could try:

 

 

ClearCollect(ListaField;
AddColumns(
Filter(
FieldMap;
(DateValue(Text(a10_intervencao)) >= dtpData.SelectedDate && DateValue(Text(a10_intervencao)) <= dtpData2.SelectedDate) ||
(DateValue(Text(a02_criado)) >= dtpData.SelectedDate && DateValue(Text(a02_criado)) <= dtpData2.SelectedDate);
IsBlank(cbEquipas.SelectedItems.Value) ||IsEmpty(cbEquipas.SelectedItems) || a05_equipa in cbEquipas.SelectedItems;
IsBlank(cbTipos.SelectedItems.Value) ||IsEmpty(cbTipos.SelectedItems) || Left(a18_tipo; 1) = Left(cbTipos.Selected.Value;1); !IsEmpty(a16_latitude);!IsEmpty(a17_longitude);!IsEmpty(a12_tecnico);!IsEmpty(a18_tipo);!IsEmpty(a04_nome)
);
"Cor";IsBlank(a12_tecnico);"icon";IsBlank(a18_tipo)
)
)

 

Best Regards,

Bof

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @jlongo :

Maybe you could try:

 

 

ClearCollect(ListaField;
AddColumns(
Filter(
FieldMap;
(DateValue(Text(a10_intervencao)) >= dtpData.SelectedDate && DateValue(Text(a10_intervencao)) <= dtpData2.SelectedDate) ||
(DateValue(Text(a02_criado)) >= dtpData.SelectedDate && DateValue(Text(a02_criado)) <= dtpData2.SelectedDate);
IsBlank(cbEquipas.SelectedItems.Value) ||IsEmpty(cbEquipas.SelectedItems) || a05_equipa in cbEquipas.SelectedItems;
IsBlank(cbTipos.SelectedItems.Value) ||IsEmpty(cbTipos.SelectedItems) || Left(a18_tipo; 1) = Left(cbTipos.Selected.Value;1); !IsEmpty(a16_latitude);!IsEmpty(a17_longitude);!IsEmpty(a12_tecnico);!IsEmpty(a18_tipo);!IsEmpty(a04_nome)
);
"Cor";IsBlank(a12_tecnico);"icon";IsBlank(a18_tipo)
)
)

 

Best Regards,

Bof

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,286)