Announcements
Just curious how many lines code is the max of the if function.when I input lots of code under If function,then the forms can't be run successfully,when I reduce the line of the code ,then the form can be run successfully.and is there any solution to fix this issue?
There is no mandatory or known limit on the number of nested If functions in an app within PowerApps.
However, the amount of the nested If function within an app would affect the app's performance. Use Switch() function instead of If function when you need to evaluate a single condition against multiple possible matches. Switch function can simplify your code and improve readability.
If you have any questions or feedback, please let me know. Have a great day! 😊-----------------------PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻
Hi @Ricky24 ,
If you can share the codes, we may be able to help you sort the problem more easily.
Best regards,
maybe my description isn't clear, only if function, but I have lots of nested under the if function like the picture shows maybe 500 lines, switch function can't achieve my request.
Hi thanks for your feedback,you can check the pic that i posted just now.
One solution here is to make a reference list with all the possibilities and do a simple lookup - much easier to maintain as well
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
appreciate your feedback
is there any video or other resource to show how to make a reference list and do a simple lookup function.
Could you create a collection OnStart of the App, where maintains DataCardValue42 options, DataCardValue43 options and corresponding Values, then you will be able to get the value using LookUp function to reference a specific value from the collection based on values in the two dropdowns.
@Ricky24 ,
Make a new list in your data source containing all the combinations that you have hard-coded.You then can do a LookUp function on your two data drop-downs and reference the third field. I assume you have done a LookUp in Power Apps ?
thanks for your suggestion.actually, I don't use a lookup value, only use the If function like below pic show,
I will try to use a lookup function to run it.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 427 Most Valuable Professional
11manish 201 Super User 2026 Season 2
MS.Ragavendar 128 Super User 2026 Season 2