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 Platform Community / Forums / Power Automate / any other option to ne...
Power Automate
Answered

any other option to nested if function?

(0) ShareShare
ReportReport
Posted on by 148

Just looking to be pointed in the right direction regarding nested if statements/functions for a flow i will be creating.

 

The flow (triggered on power app form submission)  could have the possibility of 40 different options (instructions)  that need to populate an email.

 

My thinking initially was to use a switch connector but the number of options will be greater than 25 and it also means having multiple email templates.

 

So now i am thinking having one email template based on 40 compose connectors - each compose would have the instruction text and part of this text would have a date calculation based on date values chosen in the app. And then populating a single email template with a function based on a nested if

ie   if instruction = value 1 then use Compose1

instruction = value 2 then use Compose2

etc all the way up to compose 40.

 

are there any better, more efficient ways to do this? 

 

thanks

 

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @cheezy 

    I would say if you can keep a configuration list in SharePoint or any other source where you where you keep option and required template and then do a Get Items / or List Rows and use a Filter Query based on the input parameter passed from Powerapps , it would be a good idea and easily extended if you have new options.

     

  • cheezy Profile Picture
    148 on at

    thanks for response.

    the bit i dont get above with a list is how do i included date calculations in  a template? 

     

    for example instructions may included something similar to this:

    "On the day before your appointment  on [date calculation based on appointment date] you will be required to do this blah blah

    2 days prior to your appointment on [date calculation based on appointment date]  you will need to do this blah blah blah"

     

    i can easily achieve this in a compose but not sure how in a template

     

     

     

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @cheezy 

    You can do placeholders in the template for the calculated fields like text {0} and then replace in your flow but if the calculation is also per selected option in the same row you can add number of days, do the whole calculation on flow and replace placeholders in template,Does this makes sense?

     

  • cheezy Profile Picture
    148 on at

    thanks but dont understand, for example how would this work in example above?

    say appt date is 3/5/2022

    On the day before your appointment  on [placeholder 1] you will be required to do this blah blah

    2 days prior to your appointment on [placeholder 2]  you will need to do this blah blah blah

     

    so what i would want is placeholder1 to equal 2/5/2022 and placeholder2 to be 1/5/2022 ?

     

     

     

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @cheezy 

    Can I ask a Question Back is 2 days prior something consistent or different between Templates?

  • cheezy Profile Picture
    148 on at

    different unfortunately.

    these would be the combinations:

    some may have 1 day prior only, some would have 1day and 2 day prior and others 1day,2 day and 3 day prior.

  • Verified answer
    Mira Ghaly Profile Picture
    11,415 Moderator on at

    @cheezy 

    So you list needs to look like below

    Option Number of Days Template
    Option 1 2 Text before place holder for Option 1 {0} Text After place holder for Option 1
    Option 2 1 Text before place holder for Option 2 {0} Text After place holder for Option 2
         

     

    So first step in your flow say if this configuration is in a SharePoint list so you will have;

    1. Get Items with Filter Query Option eq 'Parameter from powerapps'

    So now you have the Number of Days and the Template

    2. Calculate Date Prior based on number of days returned from one

    3. Do a compose data operation where you replace {0} by the value you calculated in 2

     

    Hope this is more clear now!

  • cheezy Profile Picture
    148 on at

    ok got it now will give it a try - thanks for help

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 282 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 159 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 146 Super User 2026 Season 2

Last 30 days Overall leaderboard