Skip to main content

Notifications

Power Platform Community / Forums / Building Flows / Power Platform Request...
Building Flows
Suggested answer

Power Platform Request Limits ; simplifying my code

Posted on by 40
Hello,
 
My flow is working correctly but I have the impression I could be simplified a lot as I'm getting a report saying I reach the 1000 request limits in 24h ? As I'm a newbie, I appreciate some help or thoughts.
The purpose of my flow is : 
When adding a event in an outlook calendar it has to check for specific words. If found it should assign a specific category to that event. 
Underneath a screenshot of my flow. I think I can be simplified, because as it is now, every word to be searched for imbricced into the previous one.
In essence look for "FU" -> apply category x, look for "IMP" -> apply category Y. 
Now it's written like look for "FU", if not found, look for "IMP", and so on.  
 
What are your suggestions ?  
Thank in advance
  • Chapeau_Melon Profile Picture
    Chapeau_Melon 40 on at
    Power Platform Request Limits ; simplifying my code
    Thanks a lot Chriddle for taking the time to look into this ! 
    I added my original flow : WeTransfer
     
    As I'm not really into this, would it be possible that make a flow based on mine and share it with me?
    This way I can analyse it and try to learn what you're trying to explain to me.
    I hope you can as it would help me tremendously. 
    You don't have to code all possibilities, maybe 3 of them and I continue trying to understand what I do.
     
    Kr, 
     
    Tom
  • Chriddle Profile Picture
    Chriddle 6,750 on at
    Power Platform Request Limits ; simplifying my code
    If you switch the order of the actions, the expressions are even simpler :)
     
    Filter array:
    From:
    [
    {"Search": "FU", "Category": "x"},
    {"Search": "IMP", "Category": "y"}
    ]
    Filter:
    outputs('Compose') contains item()['Search']
     
    Select:
    From:
    body('Filter_array')
    Map:
    item()['Category']
     
  • Suggested answer
    Chriddle Profile Picture
    Chriddle 6,750 on at
    Power Platform Request Limits ; simplifying my code
    Yes, that can be simplyfied ;)
     
    For simplicity, I use a Compose for the text to be searched, not the Event trigger.
    In a Select, check for each search term, if it appears in the text and, if so, write the according category to the output array (empty string, if not).
    Then filter for items that are not empty.
     
    The result is an array, that you can put into the Update event (V4)'s "Categories" property (switch to array input)
     
     
    Compose:
    A test FU text
     
     
    Select:
    From:
    [
    {"Search": "FU", "Category": "x"},
    {"Search": "IMP", "Category": "y"}
    ]
    Map:
    if(
    	contains(
    		outputs('Compose'),
    		item()['Search']
    	),
    	item()['Category'],
    	''
    )
     
    Filter array:
    From:
    body('Select')
    Filter:
    item() is not equal to string(null)
     
     
    The result is
     
    and can be used as Categories in Update Event (V4)
     
     
     

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,122

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,414

Leaderboard

Featured topics