cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoaoAyub
Regular Visitor

Having problems with Outlook Integration

Hello everybody, hope you´re well.

I´m using a Online/Offline APP to register maintenance in diferent equipments in locations with diferent teams.

The APP is using Sharepoint List´s as database.

So, how it suppose to work:
1 - The APP Collect the Sharepoint lists in Collections;

2 - The user register the maintenance (online or offline) on those Collections;

3 - When the User finish the day, he synchronizes the Offline data (Collection) with eh Online Data (Sharepoint);

4 - When he does that, the app sends an Email to a group of persons. And thats where the problem is.

Sometimes, in the same sync, the APP sends more than 1 email. sometimes more than 10. 
The first email arrives with the correct information, but the other, with no information, in blank.
The user can only click one time on the Sync button, because it´s only visible when the Collection has data. 

So, when the APP do the sync, it cleans the Collection (ClearCollect);


Sync Button: 

UpdateContext(
{
varShowLoading: true;
varStartLoading: true
}
);;

If(
Or(Value(Hour(Now()) & "," & Minute(Now())) > 16,00 ; Today()>varDataHj);
UpdateContext({ShowPopUp2: true});
Office365Outlook.SendEmailV2(
varEmailPCM;
"Produtividade - " & varEquipe;
"Apontamento produtividade do dia:
" & HtmlText1_Produtividade_dia.HtmlText & "<br>Apontamento Retroativo:
" & HtmlText1_Produtividade_retro.HtmlText;
{Importance: "Normal"}
);;
Concurrent(
Collect(
MatAplicados22;
Filter(
colMatAplicados22;
IsBlank(ID)
)
);
Collect(
FormPrev22;
Filter(
colFormPrev22;
IsBlank(ID)
)
)
);;
ForAll(
Filter(
RenameColumns(
colFormPrev22;
"ID";
"UpdateID"
);
Modified = DateValue("1 jan 3000")
);
Patch(
FormPrev22;
LookUp(
FormPrev22;
ID = UpdateID
);
{
PrevID: PrevID;
DataExecutada: DataExecutada;
EquipeResponsavel: EquipeResponsavel;
ObsDaCondicao: ObsDaCondicao;
AplicouMaterial: AplicouMaterial;
Status: Status;
TipodePendencias: TipodePendencias;
Pendencias: Pendencias;
MotivoDesvio: MotivoDesvio;
ObsDesvio: ObsDesvio;
Latitude: Latitude;
Longitude: Longitude;
HoraApontada: HoraApontada;
ZonaQuente: ZonaQuente;
Corredor: Corredor;
Criticidade: Criticidade
}
)
);;
ForAll(
Filter(
RenameColumns(
colEstoqueMateriais;
"ID";
"UpdateID"
);
Modificado = DateValue("1 jan 3001")
);
Patch(
EstoqueMateriais;
LookUp(
EstoqueMateriais;
ID = UpdateID
);
{EstoqueAtual: EstoqueAtual}
)
);;
Concurrent(
ClearCollect(
colFormPrev22;
FormPrev22
);
ClearCollect(
colEstoqueMateriais;
EstoqueMateriais
);
ClearCollect(
colMatAplicados22;
MatAplicados22
)
);;
If(
varSalvDisp;
SaveData(
colFormPrev22;
"sdFormPrev22"
);;
SaveData(
colEstoqueMateriais;
"sdEstoqueMateriais"
);;
SaveData(
colMatAplicados22;
"sdMatAplicados22"
)
)
)

 HTML:

"<table width='100%' border='2' cellpadding='4' style='border:1px solid black; border-collapse:collapse'><tr><th>TagAtivo</th><th>Descrição</th><th>DataPlanejada</th><th>DataExecutada</th><th>Status</th><th>Pendencia</th><th>MotivoDesvio</th><th>HoraApontada</th></tr>" & Concat(
Filter(
colFormPrev22;
!IsBlank(PrevID);
EquipeResponsavel = varEquipe;
!IsBlank(DataExecutada);
DataExecutada = varDataHj
);
"<tr style='background-color:#efefef'><td>" & TAG & "</td><td>" & Equipamento & "</td><td>" & DataPlanejada & "</td><td>" & DataExecutada & "</td><td>" & Status & "</td><td>" & Pendencias & "</td><td>" & MotivoDesvio & "</td><td>" & HoraApontada & "</td></tr>"
) & "</Table>"

 

Received emails examples:

JoaoAyub_1-1648128591906.png

 

1º Email (correct):

JoaoAyub_2-1648128744521.png

 

2° email (duplicated with no information)

JoaoAyub_3-1648128813409.png

 

3° email (same as 2°)

JoaoAyub_4-1648128884450.png


Hope someone can help me.
If you need more information, just ask.


Thanks in advance. (sorry for my english =P)

 

3 REPLIES 3
JoaoAyub
Regular Visitor

Still having this problem.
Someone can help?

Shujaath_Khan
Super User
Super User

Hi @JoaoAyub ,

 

I could notice HtmlText1_Produtividade_dia is control from which you're passing the content for table

Can you tell me how are you setting the data in this control.

If possible can you keep send mail in  if condition to check mail is to be sent only when data is there.

Thanks

Please click Accept as Solution on this reply if it helped to solve your issue, and thumbs-up if you feel this is useful or important in other ways as a boost.

JoaoAyub
Regular Visitor

It works! Thank you!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Users online (1,883)