Add condition for 2 different columns

%3CLINGO-SUB%20id%3D%22%5C%26quot%3Blingo-sub-3145357%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3EAdd%20condition%20for%202%20different%20columns%26lt%3B%5C%2Flingo-sub%26gt%3B%3CLINGO-BODY%20id%3D%22%5C%26quot%3Blingo-body-3145357%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CP%3EHi%20everyone%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EI'm%20newby%20on%20PowerApps%2C%20so%20I'm%20playing%20with%20the%20Flows.%20I%20have%20a%20SharePoint%20list%20that%20has%204%20date%20columns%3A%26lt%3B%5C%2FP%26gt%3B%3CUL%3E%3CLI%3ECreation%20Date%20(manual%20entry)%26lt%3B%5C%2FLI%26gt%3B%3C%2FLI%3E%3CLI%3EExpiration%20Date%20(calculated%20in%20base%20of%20Creation%20Date%20%2B%20730%20days)%26lt%3B%5C%2FLI%26gt%3B%3C%2FLI%3E%3CLI%3ENew%20Creation%20Date%20(manual%20entry)%26lt%3B%5C%2FLI%26gt%3B%3C%2FLI%3E%3CLI%3ENew%20Expiration%20Date%20(calculated%20in%20base%20of%20New%20Creation%20Date%20%2B%20330%20days)%26lt%3B%5C%2FLI%26gt%3B%26lt%3B%5C%2FUL%26gt%3B%3CP%3EThe%20requirement%20is%20to%20send%20an%20email%20notification%20when%20expiration%20date%20is%20coming%20on%2030%20days%20prior%20expire.%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3ESo%20I%20have%20set%20a%20flow%20as%20below%3A%26lt%3B%5C%2FP%26gt%3B%3CUL%3E%3CLI%3ESet%20a%20Get%20Items%20to%20get%20all%20the%20items%20from%20the%20sharepoint%20list.%26lt%3B%5C%2FLI%26gt%3B%26lt%3B%5C%2FUL%26gt%3B%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-inline%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346847i0FA6A76FB5B97BF5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%222022-02-09_13-41-24.png%22%20alt%3D%22%5C%26quot%3B2022-02-09_13-41-24.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%3CUL%3E%3CLI%3EThen%20set%20a%20condition%20because%20the%26nbsp%3Bnew%20creation%20date%20and%20new%20expiration%20date%20are%20not%20required%20fields%2C%20so%20it%20can%20be%20filled%20whenever%20is%20required%2C%20based%20in%20another%20field%20if%20is%20null%20or%20not.%26lt%3B%5C%2FLI%26gt%3B%26lt%3B%5C%2FUL%26gt%3B%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-inline%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346848i31B819F5DB671C97%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%222022-02-09_13-42-04.png%22%20alt%3D%22%5C%26quot%3B2022-02-09_13-42-04.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%3CUL%3E%3CLI%3EAfter%20validating%20if%20the%20previous%20field%20is%20null%2C%20then%20it%20will%20depend%20the%20Yes%2FNo%20path%20which%20is%20basically%20the%20same%2C%20using%20another%20Get%20Items%20but%20changing%20the%20filter%20query%20with%20the%20following%20formula%3A%26lt%3B%5C%2FLI%26gt%3B%3C%2FLI%3E%3CLI%3EIf%20YES%3A%26nbsp%3B%26lt%3B%5C%2FLI%26gt%3B%26lt%3B%5C%2FUL%26gt%3B%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3CPRE%20class%3D%22%5C%26quot%3Blia-code-sample%22%20language-excel-formula%3D%22%22%3E%3CCODE%3ECreationDate%20le%20%5C'%7BformatDateTime(addDays(utcNow()%2C-700)%2C%5C'yyyy-MM-dd%5C')%7D%5C'%E2%80%8B%26lt%3B%5C%2Fcode%26gt%3B%26lt%3B%5C%2Fpre%26gt%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3CUL%3E%3CLI%3EIf%20NO%3A%26nbsp%3B%26lt%3B%5C%2FLI%26gt%3B%26lt%3B%5C%2FUL%26gt%3B%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3CPRE%20class%3D%22%5C%26quot%3Blia-code-sample%22%20language-excel-formula%3D%22%22%3E%3CCODE%3ENewCreationDate%20le%20%5C'%7BformatDateTime(addDays(utcNow()%2C-330)%2C%5C'yyyy-MM-dd%5C')%7D%5C'%E2%80%8B%26lt%3B%5C%2Fcode%26gt%3B%26lt%3B%5C%2Fpre%26gt%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%5C%26quot%3Blia-inline-image-display-wrapper%22%20lia-image-align-inline%3D%22%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fgxcuf89792%2F%5C%26quot%3Bhttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346850iF053604D0B065C91%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%5C%26quot%3B%22%20role%3D%22%5C%26quot%3Bbutton%5C%26quot%3B%22%20title%3D%222022-02-09_13-43-43.png%22%20alt%3D%22%5C%26quot%3B2022-02-09_13-43-43.png%5C%26quot%3B%22%20%2F%3E%26lt%3B%5C%2Fspan%26gt%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3CUL%3E%3CLI%3EThen%20it%20triggers%20the%20email.%26lt%3B%5C%2FLI%26gt%3B%26lt%3B%5C%2FUL%26gt%3B%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EThe%20flow%20is%20working%20and%20sending%20the%20email%20properly%2C%20however%2C%20the%20issue%20is%20that%20it%20is%20triggering%20the%20email%20multiple%20times%20based%20on%20the%20number%20of%20records%20it%20finds%2C%20for%20example%2C%20in%20my%20testing%20I%20have%205%20records%20at%20the%20list%2C%202%20have%20expiration%20date%20next%20year%2C%20so%20those%20are%20fine%2C%20another%202%20records%20that%20should%20go%20through%20NO%20path%20and%201%20through%20YES%20path%2C%20so%20I%20should%20receive%20only%203%20emails%2C%20but%20instead%20of%2C%20I'm%20receiving%209%20emails%20as%20it%20is%20looping%203%20times%20the%20email%20trigger.%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EAny%20help%20on%20this%20will%20be%20appreciated.%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-body%26gt%3B%3CLINGO-LABS%20id%3D%22%5C%26quot%3Blingo-labs-3145357%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%26lt%3B%5C%2Flingo-label%26gt%3B%3CLINGO-LABEL%3ESharePoint%26lt%3B%5C%2Flingo-label%26gt%3B%26lt%3B%5C%2Flingo-labs%26gt%3B%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-SUB%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3145357%22%20slang%3D%22en-US%22%3EAdd%20condition%20for%202%20different%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3145357%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20newby%20on%20PowerApps%2C%20so%20I'm%20playing%20with%20the%20Flows.%20I%20have%20a%20SharePoint%20list%20that%20has%204%20date%20columns%3A%3C%2FP%3E%3CUL%3E%3CLI%3ECreation%20Date%20(manual%20entry)%3C%2FLI%3E%3CLI%3EExpiration%20Date%20(calculated%20in%20base%20of%20Creation%20Date%20%2B%20730%20days)%3C%2FLI%3E%3CLI%3ENew%20Creation%20Date%20(manual%20entry)%3C%2FLI%3E%3CLI%3ENew%20Expiration%20Date%20(calculated%20in%20base%20of%20New%20Creation%20Date%20%2B%20330%20days)%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThe%20requirement%20is%20to%20send%20an%20email%20notification%20when%20expiration%20date%20is%20coming%20on%2030%20days%20prior%20expire.%3C%2FP%3E%3CP%3ESo%20I%20have%20set%20a%20flow%20as%20below%3A%3C%2FP%3E%3CUL%3E%3CLI%3ESet%20a%20Get%20Items%20to%20get%20all%20the%20items%20from%20the%20sharepoint%20list.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222022-02-09_13-41-24.png%22%20style%3D%22width%3A%20620px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346847i0FA6A76FB5B97BF5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222022-02-09_13-41-24.png%22%20alt%3D%222022-02-09_13-41-24.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3EThen%20set%20a%20condition%20because%20the%26nbsp%3Bnew%20creation%20date%20and%20new%20expiration%20date%20are%20not%20required%20fields%2C%20so%20it%20can%20be%20filled%20whenever%20is%20required%2C%20based%20in%20another%20field%20if%20is%20null%20or%20not.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222022-02-09_13-42-04.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346848i31B819F5DB671C97%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222022-02-09_13-42-04.png%22%20alt%3D%222022-02-09_13-42-04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3EAfter%20validating%20if%20the%20previous%20field%20is%20null%2C%20then%20it%20will%20depend%20the%20Yes%2FNo%20path%20which%20is%20basically%20the%20same%2C%20using%20another%20Get%20Items%20but%20changing%20the%20filter%20query%20with%20the%20following%20formula%3A%3C%2FLI%3E%3CLI%3EIf%20YES%3A%26nbsp%3B%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3ECreationDate%20le%20'%7BformatDateTime(addDays(utcNow()%2C-700)%2C'yyyy-MM-dd')%7D'%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EIf%20NO%3A%26nbsp%3B%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3ENewCreationDate%20le%20'%7BformatDateTime(addDays(utcNow()%2C-330)%2C'yyyy-MM-dd')%7D'%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222022-02-09_13-43-43.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F346850iF053604D0B065C91%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222022-02-09_13-43-43.png%22%20alt%3D%222022-02-09_13-43-43.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EThen%20it%20triggers%20the%20email.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20flow%20is%20working%20and%20sending%20the%20email%20properly%2C%20however%2C%20the%20issue%20is%20that%20it%20is%20triggering%20the%20email%20multiple%20times%20based%20on%20the%20number%20of%20records%20it%20finds%2C%20for%20example%2C%20in%20my%20testing%20I%20have%205%20records%20at%20the%20list%2C%202%20have%20expiration%20date%20next%20year%2C%20so%20those%20are%20fine%2C%20another%202%20records%20that%20should%20go%20through%20NO%20path%20and%201%20through%20YES%20path%2C%20so%20I%20should%20receive%20only%203%20emails%2C%20but%20instead%20of%2C%20I'm%20receiving%209%20emails%20as%20it%20is%20looping%203%20times%20the%20email%20trigger.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20on%20this%20will%20be%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3145357%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Hi everyone

 

I'm newby on PowerApps, so I'm playing with the Flows. I have a SharePoint list that has 4 date columns:

  • Creation Date (manual entry)
  • Expiration Date (calculated in base of Creation Date + 730 days)
  • New Creation Date (manual entry)
  • New Expiration Date (calculated in base of New Creation Date + 330 days)

The requirement is to send an email notification when expiration date is coming on 30 days prior expire.

So I have set a flow as below:

  • Set a Get Items to get all the items from the sharepoint list.

2022-02-09_13-41-24.png

  • Then set a condition because the new creation date and new expiration date are not required fields, so it can be filled whenever is required, based in another field if is null or not.

2022-02-09_13-42-04.png

  • After validating if the previous field is null, then it will depend the Yes/No path which is basically the same, using another Get Items but changing the filter query with the following formula:
  • If YES: 

 

 

CreationDate le '{formatDateTime(addDays(utcNow(),-700),'yyyy-MM-dd')}'​

 

 

  • If NO: 

 

 

NewCreationDate le '{formatDateTime(addDays(utcNow(),-330),'yyyy-MM-dd')}'​

 

 

2022-02-09_13-43-43.png

 

  • Then it triggers the email.

 

The flow is working and sending the email properly, however, the issue is that it is triggering the email multiple times based on the number of records it finds, for example, in my testing I have 5 records at the list, 2 have expiration date next year, so those are fine, another 2 records that should go through NO path and 1 through YES path, so I should receive only 3 emails, but instead of, I'm receiving 9 emails as it is looping 3 times the email trigger.

 

Any help on this will be appreciated.

0 Replies