cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TML
Advocate II
Advocate II

Search code?

Is there a way to search all code in a PowerApps app?  If not, is there a way to export all code so I can search it then?  It is difficult following someone elses code and trying to find where some variable is being updated.  Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

I will either vote for an existing idea for this or create a new one.

View solution in original post

6 REPLIES 6
v-micsh-msft
Community Support
Community Support

Hi TML,

 

Thnaks for your idea.

But currently there is no proper way to search the code directly within the App Editor.

For Variables or collections, you could find it usage under 

File->Variables (Collections), select each one, and it will display the used place within the App:

83.PNG

 

If this can't meet your requirements, then please consider rise your requirements as an idea under PowerApps idea forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I will either vote for an existing idea for this or create a new one.

View solution in original post

Can you be more specific how to find where collections are used? I can see where variables are used, but your instructions for collections don't seem to provide the same informaiton. It just lists the first five items in the collection, not where it is used.

Hi KMan42,

This is kind of an old post and I don't know if the interface has changed or not since the above info was posted, but you are correct, Collections just shows the first 5 records.  What I do if I need to search badly enough is follow the below steps.

  • Export Package for my app (it only exports the most recently published version, so publish first if you need to)
  • Export creates a zip file, open it.
  • Navigate down through the zip file folders  Microsoft.PowerApps, apps, and finally a numbered folder (only one under apps)
  • Drag the .MSAPP file found in the numbered folder onto your desktop
  • Rename the .MSAPP file to .ZIP and open it
  • Drag the Entities.json file onto your desktop

This file is all the code to your app in JSON format.  I find JSON hard to work with so I convert it to XML for searching.  I use https://codebeautify.org/jsontoxml to convert it and then copy the XML text to something like Notepad++ to perform my searches.  Most likely, your JSON file is a pretty good size to be copying and pasting so give the codebeautify site a minute to process after pasting and before clicking the convert to xml button.  This is a lot of work to go through just to search so I only use it as a last resort.  I hope someone else can post a better way, but I have not found one.  Be aware that you cannot modify the files outside of the ZIP and then import back in to PowerApps as that will fail.  If you need to do that, search youtube as there are a couple tutorials on how to accomplish that.

I hope this helps you and I also hope someone else can post a better way.

 

TML

First of all, when I shared the technique @TML  describes above, I had forgotten where I'd learned it and didn't give TML credit.  Sorry about that, TML. 

 

E.g. https://powerusers.microsoft.com/t5/Power-Apps-Ideas/How-do-I-find-where-a-Collection-is-created/idc... 

 

Also, I've now come across another way to hunt missing Collection definitions/declarations and am trying to spread the word on that tool.

It's the "PowerAppps Review Tool" / (i.e. PowerApps Review Tool )

 

See https://powerusers.microsoft.com/t5/Building-Power-Apps/Finding-where-Collection-is-used/m-p/671172/...

for more info on that workaround.

 

And, if you're reading this and you haven't yet voted for one of the ideas to bring this functionality into the PApps Studio, please vote for at least one of these two ideas/suggestions:

 

1) https://powerusers.microsoft.com/t5/Power-Apps-Ideas/How-do-I-find-where-a-Collection-is-created/idc...

 

2) https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Show-all-references-to-a-collection/idc-p/67116...

 

 

Once gain, TML, I apologize if it seemed like I was "stealing your thunder."  I really try to give credit where credit is due...and your zip-export trick has saved my a$$ many times. Thanks!

lk77
Regular Visitor

This tool can help you now.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,271)